Skip to content

Instantly share code, notes, and snippets.

View mystix's full-sized avatar

Marc mystix

  • Singapore
View GitHub Profile
@mystix
mystix / gmail.sh
Created June 5, 2010 16:34
Gmail scripts
#!/bin/bash
# Script to upload MBOX file to Gmail IMAP
# note: this script requires the python GMail IMAP Upload script, "imap_upload.py"
if [ $# -eq 1 ] || [ $# -eq 2 ]; then
# for convenience, assume one GMail user/passwd if no. of command
# line arguments = 1 or 2
USER=user@domain.com
PASSWD=somePassword
@mystix
mystix / clean.sh
Created June 5, 2010 16:36
JavaScript cleanup script
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 FILENAME"
exit 1
fi
# 1) convert file to unix line endings
# 2) converts tab characters to 4 spaces
# 3) collapse multi-line c-style comments, then strip them from source
@mystix
mystix / remcomms.sh
Created June 5, 2010 16:38
Script to strip all C comments
# Strip C comments
# by Stewart Ravenhall <stewart.ravenhall@ukonline.co.uk> -- 4 October 2000
# Un-Korn-ized by Paolo Bonzini <bonzini@gnu.org> -- 24 November 2000
# Strip everything between /* and */ inclusive
# Copes with multi-line comments,
# disassociated end comment symbols,
# disassociated start comment symbols,
# multiple comments per line
@mystix
mystix / gist:428523
Created June 7, 2010 10:45
Rapidshare unpacker
#!/bin/bash
for FILE in $(find . -type f -regex '.*\.rar$'); do
mv $FILE .
done
@mystix
mystix / OSX - Chrome command line launcher.sh
Created June 24, 2010 08:17
OSX - Launch Chrome with iPad user-agent
#!/bin/bash
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--user-agent="Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10" \
> /dev/null 2>&1 &
@mystix
mystix / OSX - Firefox command line launcher.sh
Created June 24, 2010 08:18
OSX - Firefox command line launcher
#!/bin/bash
/Applications/Firefox.app/Contents/MacOS/firefox-bin -ProfileManager > /dev/null 2>&1 &
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core.js"></script>
<script>
Ext.onReady(function() {
Ext.get("wrapper").on({
drop: function(e) {
e.preventDefault();
var dt = e.browserEvent.dataTransfer,
@mystix
mystix / expressjs-example.js
Created August 20, 2010 06:22
NodeJS scripts
// ExpressJS - Hello World! example
var express = require('express'),
app = express.createServer();
app.get('/', function(req, res) {
res.redirect('/hello/world');
});
app.get('/hello/world', function(req, res) {
res.send('Hello World');
@mystix
mystix / gem-installer.sh
Created August 20, 2010 06:25
Ruby + Rails setup
#!/bin/bash
RUBY_HEAD=1.9.3
# ------- NOTE: RUN THE rvm-installer.sh SCRIPT FIRST -------
# notes:
# - --with-gcc=clang required for OSX Lion
# - readline required to fix forward-delete in irb (see http://anthonymcook.com/post/9304734590/get-the-delete-key-working-in-irb-on-osx-with-two-lines)
rvm install $RUBY_HEAD --with-gcc=clang --with-readline-dir=`brew --prefix readline`
@mystix
mystix / gist:572235
Created September 9, 2010 17:59
Huawei E1550 HSDPA USB Modem Settings
SingTel:
Telephone No: *99#
APN = internet
username = <leave blank>
password = <leave blank>
(OR)
username = 65IDEAS
password = ideas