Skip to content

Instantly share code, notes, and snippets.

View rafkhan's full-sized avatar
😳
im ok

Rafael Khan rafkhan

😳
im ok
View GitHub Profile
<?php
define('BASE_PATH', '/cafe');
define('DB_USER', 'root');
define('DB_PASS', 'password');
?>
@rafkhan
rafkhan / explain.py
Last active December 20, 2015 21:59
FOR U
class Person:
def __init__(self, name):
self.name = name
def rap(self):
print("Whuddup bitch, this is MC " + self.name)
chode = Person("Jackson")
#
@rafkhan
rafkhan / slider_thinger_idunno.js
Created August 19, 2013 17:14
From urbaneer prototype slider. Note to self: This essentially has a function that executes periodically while the mouse is hovering over an element, and can change execution on move events. Wrap this.
function viewport() {
var e = window
, a = "inner";
if ( !( "innerWidth" in window ) ) {
a = "client";
e = document.documentElement || document.body;
}
return { width : e[ a+"Width" ] , height : e[ a+"Height" ] };
}
{types: [
{ name: "post",
backend_visible: false,
fields: [{
name: "name",
type: {name: "Int", max: 250, ...},
required: true
},
{
package main
import (
"fmt"
"reflect"
)
//function types
type mapf func(interface{}) interface{}
import sys
if len(sys.argv) < 3:
print("Must specify file name")
sys.exit(0)
in_fname = sys.argv[1]
out_fname = sys.argv[2]
with open(in_fname, "r") as in_file:
acc = 1
for i in range(1, 5 + 1):
acc *= i
print(acc)
package main;
import (
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")
if err != nil {
// handle error
package main;
import (
"net"
"fmt"
"bufio"
)
var (
inboundQueue = make(chan net.Conn);
[{
id: "abcdef1234567890",
name: "Cute Little Coffee Shop",
phone: "(416) - 123 - 4567",
website: "http://cutelittlecoffeeshop.com",
location: {
lat: 10,
lng: 10,
address: "123 Main Street"
},