Skip to content

Instantly share code, notes, and snippets.

View thethomaseffect's full-sized avatar

Thomas Geraghty thethomaseffect

View GitHub Profile
@driehle
driehle / backbone-validation-bootstrap.js.coffee
Last active February 11, 2021 15:09
Render error messages of Backbone.Validation for Twitter Bootstrap
# --------------------------------------------
# This code is for Twitter Bootstrap 2!
# --------------------------------------------
#
# The MIT License (MIT)
# Copyright (c) 2012-2015 Dennis Riehle
#
# 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
@lucasdavila
lucasdavila / 1_ubuntu_terminal_command
Last active February 21, 2024 16:26
Installing Source Code Pro fonts in ubuntu
# to execute this gist, run the line bellow in terminal
\curl -L https://raw.github.com/gist/3875946/install_source_code_pro.sh | sh
@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@thethomaseffect
thethomaseffect / MaouConverter.py
Created May 6, 2013 01:48
A command-line converter from English to the language used by characters in the anime "Hataraku Maō-sama" in one line of code because I wanted to show off.
# MaouTranslator.py
print (str.lower(input("Enter English text to be translated: ")).translate(str.maketrans("abcdefghijklmnopqrstuvwxyz","azyxewvtisrlpnomqkjhugfdcb")))
@0xabad1dea
0xabad1dea / tricksy.c
Last active December 17, 2015 14:59
A deceitful C program
// hello clever programmers, would you like to play a game?
// where's the bug?
// by 0xabad1dea :)
#include <stdio.h>
#include <string.h>
int main() {
char input[16] = "stringstring!!!";
char output[8];

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns                     on recent CPU
L2 cache reference ........................... 7 ns                     14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns                     20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory

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

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@vasanthk
vasanthk / System Design.md
Last active April 26, 2024 18:05
System Design Cheatsheet

System Design 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?
@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"