Skip to content

Instantly share code, notes, and snippets.

@bar-alex
bar-alex / colorize-tomcat-logs.sh
Created June 16, 2023 08:05 — forked from zakmac/colorize-tomcat-logs.sh
Add color to your Catalina output logs for [info, warn, error, severe, startup]
#!/bin/bash
# ABOUT
# Add color to your Catalina output logs for [info, warn, error, severe, startup]
# - This isn't the smartest, so if there is a match for any of the listed statuses in an
# output you can bet it'll be colorized
# USAGE
# catalina run 2>&1 | bash ~/colorize-tomcat-logs.sh
@bar-alex
bar-alex / shopify.dart
Created November 5, 2022 18:16 — forked from slightfoot/shopify.dart
Shopify example app - by Simon Lightfoot - 05/11/2022
// MIT License
//
// Copyright (c) 2022 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@bar-alex
bar-alex / bouncy_top_sheet.dart
Created October 19, 2022 20:13 — forked from slightfoot/bouncy_top_sheet.dart
Bouncy Top Sheet - by Simon Lightfoot - 19/10/2022
import 'package:flutter/material.dart';
void main() {
runApp(const ExampleApp());
}
@immutable
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@bar-alex
bar-alex / what-forces-layout.md
Created August 24, 2022 17:17 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@bar-alex
bar-alex / Cool snippets ~ ongoing
Last active July 17, 2022 23:02
corrected typo
-- React: disables the 'dependencies missing' warning for useEffect
// eslint-disable-line react-hooks/exhaustive-deps
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
-- drop the tables then re-create the sample data
drop table if exists employee_detail, laptop_detail, jobs_history, current_job_detail;
CREATE TABLE employee_detail (employee_id INT, name VARCHAR(255), date_of_birth INT, gender VARCHAR(1)); INSERT INTO employee_detail VALUES (1000,"Bob",20000304,"M"), (1001,"Joe",19740310,"M"), (1002,"Adam",19640312,"M"), (1003,"Debra",19910306,"F"), (1004,"Charlotte",19870307,"F"), (1005,"Katie",19960304,"F"), (1006,"Sam",19620313,"F"), (1007,"Ashley",19810308,"U"), (1008,"Robert",19680311,"M"), (1009,"Usman",19850307,"M"), (1010,"Andrea",19980304,"F"), (1011,"Vaskor",19680311,"M"), (1012,"Catherine",19890306,"F"), (1013,"Graham",19660312,"F"), (1014,"Christopher",19840307,"M"), (1015,"Laura",19780309,"F"), (1016,"Tanya",19940305,"U"), (1017,"Rachael",19910306,"F");
CREATE TABLE laptop_detail (laptop_id INT, os VARCHAR(255), date_of_manufacture INT); INSERT INTO laptop_detail VALUES (9000,"Mac",20171024), (9001,"Ubuntu",20161125), (9002,"Windows",20180511), (9003,"Mac",2016
-- drop the tables then re-create the sample data
drop table if exists employee_detail, laptop_detail, jobs_history, current_job_detail;
CREATE TABLE employee_detail (employee_id INT, name VARCHAR(255), date_of_birth INT, gender VARCHAR(1)); INSERT INTO employee_detail VALUES (1000,"Bob",20000304,"M"), (1001,"Joe",19740310,"M"), (1002,"Adam",19640312,"M"), (1003,"Debra",19910306,"F"), (1004,"Charlotte",19870307,"F"), (1005,"Katie",19960304,"F"), (1006,"Sam",19620313,"F"), (1007,"Ashley",19810308,"U"), (1008,"Robert",19680311,"M"), (1009,"Usman",19850307,"M"), (1010,"Andrea",19980304,"F"), (1011,"Vaskor",19680311,"M"), (1012,"Catherine",19890306,"F"), (1013,"Graham",19660312,"F"), (1014,"Christopher",19840307,"M"), (1015,"Laura",19780309,"F"), (1016,"Tanya",19940305,"U"), (1017,"Rachael",19910306,"F");
CREATE TABLE laptop_detail (laptop_id INT, os VARCHAR(255), date_of_manufacture INT); INSERT INTO laptop_detail VALUES (9000,"Mac",20171024), (9001,"Ubuntu",20161125), (9002,"Windows",20180511), (9003,"Mac",2016
drop table if exists movie, actor;
create table movie ( id int unique not null auto_increment primary key, title varchar(255), rating int );
create table actor ( id int unique not null auto_increment primary key, full_name varchar(255), id_movie int, foreign key (id_movie) references movie(id) );
insert into movie (title, rating) values ("Spiderman", 2);
insert into movie (title, rating) values ("Ironman", 1);
insert into actor (full_name, id_movie) values ("Andrew Garfield", (select id from movie where title = "Spiderman") );
insert into actor (full_name, id_movie) values ("Toby Maguire", (select id from movie where title = "Spiderman") );
@bar-alex
bar-alex / gist:8e706ccfee19bfdb29dbff594cd59a2f
Created May 28, 2022 19:49 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: