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
#!/sw/bin/python2.7
# This is a demonstration script for Facebook Chat
# using the X-FACEBOOK-PLATFORM SASL mechanism.
# It requires pyfacebook and pyxmpp to be installed.
# This client only works for desktop applications (configured in the
# developer app), and uses the old-style auth.getSession mechanism to get a
# Facebook session. For newer-style or web apps, only the
# 'get_facebook_client' function should have to change.
#!/usr/bin/python
import sys, os, threading
def get_facebook_client():
import facebook
# Replace these with your app's credentials
api_key = '147201912033054'
secret_key = '61ef5734be20d29715ef1133e9456834'
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
a = Array.new
hash = {:file1 => [:lib1, :lib2, :lib3], :file2 => [:lib4, :lib5, :lib6]}
hash.each do |key, val|
a.push *val
a.push key
end
<?php
/*
* Route urls
*/
class Router {
function __construct($query_str) {
$this->url_str = $_GET['route']; //Get end of url
$this->qtokens = explode('/', string); //get tokens split at '/'
class RPool
attr_accessor :max_size
attr_reader :workers
def initialize(max_size = 128)
@max_size = max_size
@workers = Array.new
@mutex = Mutex.new
end
URxvt.font: xft:terminus:pixelsize=12:antialias=true
urxvt*scrollBar: false
urxvt*termName: rxvt-256color
urxvt*resizehints: True
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.iso14755: False
URxvt.perl-ext-common: default,clipboard
!black.normal : xoria256.LineNr.guibg
-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
vicious = require("vicious")
bigPipe.onPageletArrive({
"content": {
"pagelet_sidebar": {
"container_id": "ubu35dj60"
}
},
"jsmods": {
"instances": [
["m315515_66", ["ScrollableArea", "m315515_65"],
[{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void isort(int* arr, int len) {
int i, j;
for(i = 1; i < len; i++) {
int temp = arr[i];
for(j = i; j > 0; j--) {
if(arr[j] < arr[j - 1]) {
int temp2 = arr[j];