Skip to content

Instantly share code, notes, and snippets.

View jsam's full-sized avatar
🦁

sam jsam

🦁
View GitHub Profile
@danarbaugh
danarbaugh / Snowflake.java
Created February 11, 2011 22:31
a rough java applet for drawing koch's snowflake
//Java program to draw a von Koch Snowflake
import java.awt.*;
import javax.swing.*;
public class Snowflake extends JApplet
{
int level = 0;
public void init()
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@mreid
mreid / INSTALL-VW-OSX.md
Created January 29, 2012 21:59
Install Vowpal Wabbit on Mac OS X Lion

The INSTALL instructions that come with Vowpal Wabbit appear not to work on Mac OS X Lion. Here's what I did to get it to compile. You will need the developer tools that come with the XCode installation.

The only dependency VW has is the boost C++ library. So first, download and install Boost

To install Boost, do the following:

$ cp ~/Downloads/boost_1_48_0.tar.bz2 ./
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 27, 2024 16:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tbjers
tbjers / backup.sh
Created August 22, 2012 23:10
Round Robin MongoDB backups to S3 with Tar
#!/bin/sh
#Change these settings to match your system
ACCESS_KEY='YOUR_ACCESS_KEY'
ACCESS_SECRET='YOUR_SECRET_KEY'
BUCKET="YOUR_BUCKET_NAME"
DATABASE="YOUR_DATABASE_NAME"
# Do not change anything below this line
tool=`which s3multiput s3cmd`
@rantav
rantav / README.md
Created August 23, 2012 06:13
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@xcambar
xcambar / LICENSE
Last active November 20, 2015 12:57
Authenticated routing using AngularJS
Copyright (c) 2015 - Xavier Cambar <@ xcambar_gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@jsam
jsam / gist:5006978
Last active December 14, 2015 01:29
lisp ref.
http://www.paulgraham.com/avg.html
http://programmers.stackexchange.com/questions/55284/is-lisp-still-useful-in-todays-world-which-version-is-most-used
http://norvig.com/paip.html
http://stackoverflow.com/questions/108201/common-lisp-or-scheme