Skip to content

Instantly share code, notes, and snippets.

View aoberoi's full-sized avatar
👷‍♂️
Under construction

Ankur Oberoi aoberoi

👷‍♂️
Under construction
View GitHub Profile
@aoberoi
aoberoi / swprinceton.txt
Created November 12, 2011 00:35
Princeton Startup Weekend Presentation
$$$$$$\ $$$$$$$$\ $$\
$$ __$$\ \__$$ __| $$ |
$$ / $$ | $$$$$$\ $$$$$$\ $$$$$$$\ $$ | $$$$$$\ $$ | $$\
$$ | $$ |$$ __$$\ $$ __$$\ $$ __$$\ $$ |$$ __$$\ $$ | $$ |
$$ | $$ |$$ / $$ |$$$$$$$$ |$$ | $$ |$$ |$$ / $$ |$$$$$$ /
$$ | $$ |$$ | $$ |$$ ____|$$ | $$ |$$ |$$ | $$ |$$ _$$<
$$$$$$ |$$$$$$$ |\$$$$$$$\ $$ | $$ |$$ |\$$$$$$ |$$ | \$$\
\______/ $$ ____/ \_______|\__| \__|\__| \______/ \__| \__|
$$ |
$$ | powered by TokBox :)
@aoberoi
aoberoi / add_remote.sh
Created November 15, 2011 15:03
Git: Adding an origin into an existing repo and tracking it
git remote add origin [email protected]:MyRepo
@aoberoi
aoberoi / cron_job.sh
Created November 15, 2011 15:22
Wordpress Database Backups
@daily /home/user/cronjob2.sh
@aoberoi
aoberoi / new_user.txt
Created December 27, 2011 03:02
MySQL New Database/User
$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)
@aoberoi
aoberoi / metadata.js
Created January 20, 2012 18:12
OpenTok Metadata
var session = TB.initSession(sessionID);
session.addEventListener("sessionConnected", sessionConnectedHandler);
session.connect(apiKey, token);
function sessionConnectedHandler(event) {
for (var i = 0; i < event.connections; i++) {
var connection = event.connections[i];
console.log(connection.data);
}
}
@aoberoi
aoberoi / make.log
Created January 26, 2012 03:26
rvm installing ruby-1.9.3-p0
[2012-01-25 18:51:12] make
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -fPIC
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -I. -I.ext/include/x86_64-linux -I./include -I.
DLDFLAGS = -Wl,-soname,libruby.so.1.9
SOLIBS = -lpthread -lrt -ldl -lcrypt -lm
compiling main.c
/Users/ankur/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
@aoberoi
aoberoi / binding_generics.js
Created May 21, 2012 23:53
Bind generic values to make specialized versions of a function
var myCoolFunc, getContext;
getContext = function () {
return "specific context";
};
// generic function
myCoolFunc = function (param1, context) {
console.log(param1 + ' ' + context)
};
@aoberoi
aoberoi / fbtest.html
Created May 21, 2012 23:58
something to do with facebook sharing.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page Title</title>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
@aoberoi
aoberoi / node-tmp.conf
Created May 22, 2012 00:02
Node app that will drop its own privileges, does not fork or daemonize itself, Upstart 1.3
#!upstart
description "Node app that will drop its own privileges, does not fork or daemonize itself, Upstart 1.3"
author "Ankur Oberoi"
# this script will be reading files from the local filesystem and
# and needs a network interface other than the loopback
start on (local-filesystems and net-device-up IFACE!=lo)
# stops when the machine is shut down
stop on shutdown