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
;; -*- mode: emacs-lisp; -*- | |
;; Usage: Just type. In text-mode (and derived modes) when you type ' | |
;; and ", they will be converted to ‘’ and “”. Two dashes "--" will | |
;; be converted to an en-dash, and with an extra dash followed, they | |
;; will be converted to an em-dash. | |
;; | |
;; This also works in AUCTeX automagically(TM). Just type and let | |
;; Emacs take care of the rest. | |
;; |
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 python3 | |
# For Python 3 | |
###################################################################### | |
################### Read from stdin and Zalgo-ify #################### | |
############# By MetroWind <chris.corsair {AT} gmail> ################ | |
###################################################################### | |
import sys, os |
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
# -*- coding: utf-8; -*- | |
# Calculate password strength. Algorithm is based on the | |
# Wolfram|Alpha’s, without dictionary and “extra critira”. | |
# | |
# Darksair | |
# Usage: Strength = pwStrength(password). | |
import re |
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
tell application "iTunes" | |
set CurrentTrack to current track | |
set CurrentTitle to name of CurrentTrack | |
set CurrentArtist to artist of CurrentTrack | |
end tell | |
set SongInfo to {CurrentArtist, " — ", CurrentTitle} as string | |
set Tweet to {"#NowPlaying ", SongInfo} as string | |
set the clipboard to Tweet | |
do shell script "afplay /System/Library/Sounds/Ping.aiff" |
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 python3 | |
import sys, os | |
import zlib | |
ChunkSize = 1024*1024 | |
def crcFile(f): | |
Chunk = f.read(ChunkSize) | |
CRC = 0 |
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 python3 | |
# Usage: $0 SIZE | |
# | |
# SIZE can be string like "512k", "1G"... | |
SectorSize = 512 # Bytes | |
SIZE_UNITS = {'b': 1.0, 'c': 1.0, 'w': 2.0, 'k': 1024.0, | |
'M': 1024.0 * 1024.0, 'G': 1024.0 ** 3.0, | |
'T': 1024.0 ** 4.0, 'P': 1024.0 ** 5.0, | |
} |
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
#include <iostream> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <sys/time.h> | |
typedef int Type; | |
struct Measurement | |
{ | |
double Value; |
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
div#content h1#firstHeading | |
{ | |
font-family: ScalaOT, Scala, Mate, Palatino, STZhongsong, "Songti SC", serif; | |
font-variant:small-caps; | |
margin-top: 1.5em; | |
} | |
div#bodyContent | |
{ | |
width: 520pt; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body style="background-color: #ff4e0c"> | |
</body> | |
</html> |
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
#include <stdio.h> | |
int main() | |
{ | |
#ifdef __GNUC__ | |
printf("I'm gcc. yay~~\n"); | |
#else | |
printf("I'm not gcc. Yay~~\n"); | |
#endif |
OlderNewer