Skip to content

Instantly share code, notes, and snippets.

View ethernetium's full-sized avatar

Nissi NassimE ethernetium

View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@whit
whit / .Xresources
Created October 23, 2011 17:19
Personal ~/.Xresources settings. With some rxvt-unicode tweaks, Solarized color theme etc...
##############
# Xft settings
##############
Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@yano3
yano3 / gist:1378948
Created November 19, 2011 15:17
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
@lucashorton
lucashorton / gist:1708983
Created January 31, 2012 05:11
HTML5 Tutorial

HTML5 Basics

This tutorial will introduce you to the basics of the HTML5 markup language, which can be used to create the content portion of your web site. We will be using HTML5 to build a basic blog.

To get started with this tutorial, all you need is a text editor and a web browser. Just about any text editor will do, as long as it can save files as plain text. On Windows, Notepad will work fine, though there are a number of free text editors that might provide a better experience. Notepad++, available online at http://notepad-plus-plus.org/ is one such editor. On the Mac, I recommend downloading a copy of TextWrangler from http://www.barebones.com/products/textwrangler.

Since we're working with HTML5 and it's a relatively new language, you will want to make sure you have a browser that supports the new features. I recommend the latest version of Chrome, Safari, or Firefox. Internet Explorer 9 should also work just fine.

Getting started

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

XTerm*utf8: 1
XTerm*faceName: DejaVu Sans Mono
XTerm*faceSize: 13
XTerm*background: #000000
XTerm*foreground: #aaaaaa
XTerm*metaSendsEscape: true
XTerm*colorBD: #ffffff
XTerm*colorBDMode: true
XTerm*cursorBlink: false
XTerm*cursorColor: #bbbbcc
@jfarmer
jfarmer / 01-truthy-and-falsey-ruby.md
Last active March 5, 2025 10:26
True and False vs. "Truthy" and "Falsey" (or "Falsy") in Ruby, Python, and JavaScript

true and false vs. "truthy" and "falsey" (or "falsy") in Ruby, Python, and JavaScript

Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).

This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.

If you want to use or share this material, please see the license file, below.

Update

@bobspace
bobspace / css_colors.js
Last active December 9, 2024 21:20
All of the CSS Color names in a big javascript object.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript object containing all of the color names listed in the CSS Spec.
// This used to be a big array, but the hex values are useful too, so now it's an object.
// If you need the names as an array use Object.keys, but you already knew that!
//
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
@joaopizani
joaopizani / .screenrc
Created May 17, 2012 11:55
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@jboner
jboner / latency.txt
Last active October 15, 2025 09:07
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
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 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD