Skip to content

Instantly share code, notes, and snippets.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jaredgrady
jaredgrady / bin_search.py
Last active April 10, 2017 15:35
Binary search a list of ints. Recursive implementation in Python.
def bin_search(L, a):
if (len(L) == 1):
return "NO"
mid = len(L) // 2
if (a < L[mid]):
return bin_search(L[:mid], a)
elif (a > L[mid]):
return bin_search(L[mid:], a)
@diegoconcha
diegoconcha / redux_egghead_notes.md
Last active January 18, 2022 13:23
Redux Egghead.io Notes

###Redux Egghead Video Notes###

####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.

Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.

####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree

@ozziexsh
ozziexsh / _grid.scss
Last active September 8, 2017 11:45
SCSS Grid Component
$columns: 12;
$grid-breakpoints: (
xs: 0,
sm: 544px,
md: 768px,
lg: 992px,
xl: 1200px
);
@ohanhi
ohanhi / frp.md
Last active December 23, 2022 13:06
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;

Emacs cheatsheet

  • C-x C-c End emacs session
  • C-g Partially quit entered command

  • C-v Move forward one screenful
  • M-v Move backward one screenful
  • C-l Move the text around the cursor to the center of the screen. Also, it clears the screen and redisplay all the text
@kyledrake
kyledrake / gist:d7457a46a03d7408da31
Last active October 22, 2023 12:25
Creating a self-signed SSL certificate, and then verifying it on another Linux machine
# Procedure is for Ubuntu 14.04 LTS.
# Using these guides:
# http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/
# https://turboflash.wordpress.com/2009/06/23/curl-adding-installing-trusting-new-self-signed-certificate/
# https://jamielinux.com/articles/2013/08/act-as-your-own-certificate-authority/
# Generate the root (GIVE IT A PASSWORD IF YOU'RE NOT AUTOMATING SIGNING!):
openssl genrsa -aes256 -out ca.key 2048
openssl req -new -x509 -days 7300 -key ca.key -sha256 -extensions v3_ca -out ca.crt
@CreaturePhil
CreaturePhil / gitnotes.md
Last active August 29, 2015 14:09
Git notes

Git setup

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

Check your settings

@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing