Skip to content

Instantly share code, notes, and snippets.

@timc1
timc1 / useTheme2.tsx
Created April 18, 2020 20:10
🌑☀️core app system/light/dark mode theming + varying themes for nested components
import * as React from "react";
type ThemeConfig = "system" | "light" | "dark";
type ThemeName = "light" | "dark";
// Custom themes are keyed by a unique id.
type KeyedThemes = {
[k: string]: {
config: ThemeConfig;
themeName: ThemeName;
};
@IanColdwater
IanColdwater / twittermute.txt
Last active March 6, 2024 18:49
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet

FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

@bobbygrace
bobbygrace / trello-css-guide.md
Last active February 13, 2024 14:31
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@etozzato
etozzato / gist:85da5cb66ab935d06ebf
Created October 13, 2014 23:20
Window Resize
// in the component's didInsertElement
$(window).on('resize', function() {
return Em.run.debounce(that, 'resizeWindow', 250);
});
// in the route's willTransition
$(window).off('resize');
@iansinnott
iansinnott / docker_wrapper.sh
Last active March 20, 2016 12:29
Automatically set up boot2docker on a Mac whenever `docker` is called
#!/bin/bash
# A wrapper for the docker binary. Checks to make sure the docker host is
# set before executing docker commands.
docker() {
# Start the daemon if it's not running
if [ $(boot2docker status) != 'running' ]; then
echo 'Starting the Docker daemon.'
boot2docker start
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active March 14, 2024 15:10
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@maephisto
maephisto / Javascript ISO country code to country name conversion
Last active November 3, 2023 21:05
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
@ghiden
ghiden / nodejs_decode_sample.js
Created June 29, 2011 05:11
decode a base64 encoded image file with node.js
var fs = require('fs'),
decode64 = require('base64').decode;
var data = fs.readFileSync('./encode.png', 'base64');
var buffer = new Buffer(data, 'base64');
fs.writeFileSync('./decode.png', decode64(buffer), 'binary')