This file contains 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
/* Cascaded function calls in C */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct Object Object; | |
struct Object { | |
Object* (*foo)(Object*); | |
}; |
This file contains 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
syntax on | |
set fileencodings=utf-8,big5,ucs-bom,iso8859-1 | |
set termencoding=utf-8 | |
set encoding=utf-8 | |
set shiftwidth=4 | |
set tabstop=4 | |
set expandtab | |
set nocompatible | |
set hlsearch |
This file contains 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
$(function() { | |
var num = Math.round(Math.random(new Date()) * 46) % 46; | |
if (num < 26) { | |
num = num + 65; | |
} else { | |
num = num % 26; | |
num = num + 97; | |
} | |
alert(String.fromCharCode(num)); | |
}); |
This file contains 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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# generate json data from txt file | |
import re | |
def main(): | |
words = [] | |
file = open("words.txt") | |
while True: |
This file contains 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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import curses | |
import time | |
import sys | |
def main(curses): | |
pad = curses.newpad(100, 100) | |
for y in range(0, 100): |
This file contains 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
" cursor highlight | |
set cursorline | |
highlight CursorLine cterm=NONE ctermbg=Black | |
autocmd InsertEnter * set nocursorline | |
autocmd InsertLeave * set cursorline |
This file contains 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
[ 0.000000] Initializing cgroup subsys cpuset | |
[ 0.000000] Initializing cgroup subsys cpu | |
[ 0.000000] Linux version 2.6.24-26-generic (buildd@vernadsky) (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)) #1 SMP Tue Dec 1 18:37:31 UTC 2009 (Ubuntu 2.6.24-26.64-generic) | |
[ 0.000000] BIOS-provided physical RAM map: | |
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009f400 (usable) | |
[ 0.000000] BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved) | |
[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) | |
[ 0.000000] BIOS-e820: 0000000000100000 - 000000009fff0000 (usable) | |
[ 0.000000] BIOS-e820: 000000009fff0000 - 000000009fff3000 (ACPI NVS) | |
[ 0.000000] BIOS-e820: 000000009fff3000 - 00000000a0000000 (ACPI data) |
This file contains 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
#! /usr/bin/env sh | |
for master in $(nmblookup -M -- - | grep -v '^querying' | awk '{ print $1 }'); do | |
smbclient -U% -L $master 2>&1 1>/dev/null | grep '^Domain=' | head -n 1 | awk '{ split( $1, field, /[\[\]]/); print field[2] }' | |
done |
This file contains 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
#! /usr/bin/env bash | |
xrandr --newmode "1280x1024" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync | |
xrandr --addmode VGA1 1280x1024 | |
xrandr --output LVDS1 --off --output VGA1 --mode 1280x1024 |
This file contains 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
#! /usr/bin/env bash | |
set -e -x | |
sizes="16 22 24 32 48 64 128 256" | |
for size in $sizes; do | |
[ ! -d icons/${size} ] && mkdir -p icons/${size} | |
convert -resize ${size}x${size} $1 icons/${size}/$2.png | |
done |
OlderNewer