This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
typealias Quality = Int | |
typealias SellIn = Int | |
typealias UpdateRule = (Quality, SellIn) -> Quality | |
enum ItemType { | |
case normal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, run: | |
# virtualenv venv | |
# . venv/bin/activate | |
# pip install beautifultable | |
import csv | |
from beautifultable import BeautifulTable | |
# import numpy as np | |
# map: 6+2 -> graduation_date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title>meteor external api example</title> | |
</head> | |
<body> | |
<table> | |
<p>{{{verse.verse}}}</p> | |
<p>{{{verse.text}}}</p> | |
</table> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt” | |
# Shamelessly copied from https://github.com/gf3/dotfiles | |
# Screenshot: http://i.imgur.com/s0Blh.png | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then | |
export TERM=gnome-256color | |
elif infocmp xterm-256color >/dev/null 2>&1; then | |
export TERM=xterm-256color | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function main() | |
{ | |
$count = 3; | |
$count2 = 1; | |
while(True) { | |
$isprime = True; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt” | |
# Shamelessly copied from https://github.com/gf3/dotfiles | |
# Screenshot: http://i.imgur.com/s0Blh.png | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then | |
export TERM=gnome-256color | |
elif infocmp xterm-256color >/dev/null 2>&1; then | |
export TERM=xterm-256color | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b = '10' # binary input | |
b = b[::-1] | |
number = 0 | |
for i in b: | |
i = int(i) | |
if i != 0: | |
number += 2**i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 10 | |
nums = [] | |
if i == 0: | |
nums.append(0) | |
else: | |
while i >= 1: | |
if (i//2) % 2 == 0: | |
nums.append(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var index = lunr(function() { | |
this.field('title', { | |
boost: 10 | |
}) | |
this.field('body') | |
this.ref('id') | |
}); | |
{% for post in site.posts %} | |
index.add({ |
NewerOlder