Skip to content

Instantly share code, notes, and snippets.

@DarkThrone
DarkThrone / init-laptop.sh
Created May 8, 2019 05:53
A simple script to install utilities in ubuntu 19.04
#!/bin/bash
set -xeuo pipefail
IFS=$'\n\t'
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root, use sudo "$0" instead" 1>&2
exit 1
fi
apt update
/**------------------------------------------------\
* Conway's Game of Life by Geronimo Garcia Sgritta |
* -------------------------------------------------/
*
* This is a classica implementation of the GoL, a
* cellular automata zero-player game.
*
* This example was created to test canvas performance
* with heavy calculations and pixel buffers.
*
@DarkThrone
DarkThrone / System Design.md
Created April 18, 2016 05:39 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Interview Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@DarkThrone
DarkThrone / Selector-Specificity.markdown
Last active August 29, 2015 14:17
Selector Specificity
@DarkThrone
DarkThrone / All-Selector.markdown
Last active August 29, 2015 14:17
All Selector

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@DarkThrone
DarkThrone / scrollTo.js
Created May 26, 2014 13:54
scrollTo.js function by james2doyle
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};
@DarkThrone
DarkThrone / webdev-handbook.md
Created September 15, 2012 18:07
Tips and triks for web development

Postgresql tips

List databases in postgres

db=# \l

List tables in postgres

db=# \dt
@DarkThrone
DarkThrone / Gemfile
Created September 13, 2012 19:02
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin