Skip to content

Instantly share code, notes, and snippets.

@captn3m0
captn3m0 / LICENSE.txt
Created September 28, 2011 14:16 — forked from p01/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@ryansmith3136
ryansmith3136 / hack-reactor.md
Last active November 24, 2022 07:01
Hack Reactor Talk

Tales From a Heroku User

Here are some things I have learned along the way.

Last Updated: 2013-02-08

Original Audience: Hack Reactor

About

@ourmaninamsterdam
ourmaninamsterdam / gist:b2bda53a5b1ecbb2133c
Created May 7, 2014 13:57
Libary-less addClass and removeClass functions
function addClass(elem, newClass) {
var curClass = elem.className;
if(!new RegExp(newClass,'i').test(curClass)){
if(curClass.length > 0 && curClass.charAt(curClass.length) === '') {
newClass = ' ' + newClass;
}
elem.className += newClass;
}
};
@Kartones
Kartones / postgres-cheatsheet.md
Last active January 8, 2026 15:01
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@ourmaninamsterdam
ourmaninamsterdam / setCssAttributeValue.js
Created April 8, 2015 12:35
Set CSS attribute value
function setCSSAttributeSelectorValue(selector, value) {
return selector.slice(0, selector.lastIndexOf(']')) + '=' + value + ']';
}
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active December 17, 2025 23:35
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
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:
@ourmaninamsterdam
ourmaninamsterdam / createRandomString.js
Created August 8, 2015 14:26
createRandomString()
function createRandomString(minLen, maxLen) {
var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''),
stringLen = Math.floor(Math.random() * (maxLen - minLen + 1)) + minLen,
string = '';
for(var i = 0; i < stringLen; i++) {
string += alphabet[Math.floor(Math.random() * alphabet.length)];
}
return string;
}
@0xDE57
0xDE57 / config.md
Last active October 24, 2025 12:09
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@kgrz
kgrz / part1.md
Created February 17, 2016 05:00 — forked from practicingruby/part1.md

Inheritance is a key concept in most object-oriented languages, but applying it skillfully can be challenging in practice. Back in 1989, M. Sakkinen wrote a paper called Disciplined inheritance that addresses these problems and offers some useful criteria for working around them. Despite being more than two decades old, this paper is extremely relevant to the modern Ruby programmer.

Sakkinen's central point seems to be that most traditional uses of inheritance lead to poor encapsulation, bloated object contracts, and accidental namespace collisions. He provides two patterns for disciplined inheritance and suggests that by normalizing the way that we model things, we can apply these two patterns to a very wide range of scenarios. He goes on to show that code that conforms to these design rules can easily be modeled as ordinary object composition, exposing a solid alternative to tradi