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
#include <glib.h> | |
#include <locale.h> | |
// gcc -Wall -Werror -g hello.c `pkg-config --cflags --libs glib-2.0` -o hello | |
int main(int argc, char* argv[]) | |
{ | |
setlocale(LC_ALL, "en_US.utf8"); | |
g_print ("哈囉世界\n"); | |
return 0; |
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
/* -*- coding: utf-8; indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- */ | |
/** | |
* Copyright (C) 2013 Shih-Yuan Lee (FourDollars) <[email protected]> | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
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
#!/usr/bin/env lsc | |
require! fs | |
require! request | |
require! prompt | |
{map} = require \prelude-ls | |
{spawn} = require \child_process | |
oauth_consumer_key = 'node script' |
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
#!/usr/bin/env lsc | |
require! csv | |
require! fs | |
speakers = [] | |
csv! | |
.from.stream fs.createReadStream __dirname + \/coscup2013-cfp.csv, do | |
delimiter: \, |
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
#!/bin/sh | |
oauth_consumer_key='just+testing' | |
for x in $(wget -q --post-data "oauth_consumer_key=$oauth_consumer_key&oauth_signature_method=PLAINTEXT&oauth_signature=%26" https://launchpad.net/+request-token -O - | sed 's/&/ /g'); do | |
case "$x" in | |
(oauth_token=*) | |
oauth_token="${x#*=}" | |
;; | |
(oauth_token_secret=*) |
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
#!/usr/bin/env lsc | |
require! express | |
require! request | |
app = express! | |
oauth_consumer_key = 'just+testing' | |
var oauth_token | |
var oauth_token_secret |
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
express = require \express | |
app = express! | |
app.use require(\connect-compiler) do | |
enabled: <[ livescript ]> | |
src: 'assets' | |
dest: 'assets' |
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
#!/bin/busybox sh | |
JSON="$(echo '{"modalias":['; find /sys -name modalias -exec cat {} \; 2>/dev/null | grep -e '^\(pci\|usb\)' | sort | sed 's/^/"/' | sed 's/$/",/\'; busybox echo -n ']}')" # Find all pci/usb modaliases. | |
JSON="$(echo $JSON | sed 's/, ]}/]}/' | sed 's/\s\+//g')" # Remove trailing comma and white-space characters. | |
wget -q --header 'content-type: application/json' --post-data "$JSON" http://localhost:8000 -O - |
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
require! 'http' | |
url = 'http://ppa.launchpad.net/fourdollars/fglrx/ubuntu/dists/oneiric/main/binary-amd64/Packages' | |
parse = (data) -> | |
lines = data.split "\n" | |
for line in lines | |
if line.match /^Package/ | |
pkg = line.split /\s+/ .[1] | |
else if line.match /^Version/ |
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
https://github.com/fourdollars/scripts/blob/master/ubuntu/dkms-helper.sh |