Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
javascript: function iprl6() {
var d = document,
z = d.createElement('scr' + 'ipt'),
b = d.body;
try {
if (!b) throw (0);
d.title = '(Saving...) ' + d.title;
z.setAttribute('src', 'http://www.instapaper.com/j/UNIQUE_INSTAPAPER_ID?u=' + encodeURIComponent(d.location.href) + '&t=' + (new Date().getTime()));
b.appendChild(z);
} catch(e) {
javascript: (function () {
var n = null,
C = false;
function h(m) {
d(m, "jsgif_overlaid");
m.removeEventListener("click", i, C)
}
function i(m) {
var o = this;
@victusfate
victusfate / github.coffee
Created April 13, 2011 01:52
github api with coffeescript
show = (text, target) ->
out = $("#" + target)
out.hide()
out.html text
out.fadeIn()
# https://api.github.com/users/victusfate/repos
GetMyRepos = (uname) ->
github_repo_api = "https://api.github.com/users/" + uname + "/repos?callback=?"
require 'rubygems'
require 'json'
require 'redis'
class RedisComments
def initialize(redis,namespace,sort_proc=nil)
@r = redis
@namespace = namespace
@sort_proc = sort_proc
end
@victusfate
victusfate / Excel.php
Created April 25, 2011 22:04 — forked from ihumanable/Excel.php
Simple Excel Writer in PHP
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
@victusfate
victusfate / va_args_test.cpp
Created April 28, 2011 17:12
variable args with template example
#include <stdarg.h>
#include <stdlib.h>
#include <iostream>
template<class T>
T sum(long n,...) {
long i;
va_list a;
va_start( a, n );
T osum=0;
@victusfate
victusfate / curry.cpp
Created April 28, 2011 22:24
example of currying in c++
#include <stdarg.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
typedef void* vp;
typedef vp(*Me)(vp);
template<class T>
vp addOne(vp vtemp) {
@victusfate
victusfate / Fptr.h
Created April 30, 2011 13:42
this is the basic function pointer include file I use
#ifndef F_PTR_H
#define F_PTR_H
using namespace std;
typedef void* vp;
typedef vp(*Fptr1)(vp);
typedef vp(*Fptr2)(vp,vp);
typedef vp(*Fptr3)(vp,vp,vp);
@victusfate
victusfate / mArray.h
Created April 30, 2011 13:44
basic array data structure in c++
#ifndef M_ARRAY
#define M_ARRAY 1
#include <stdlib.h>
#include <iostream>
#include "Fptr.h"
using namespace std;
@victusfate
victusfate / sorts.cpp
Created April 30, 2011 13:45
folding, qsort in place, qsort with temp arrays
#include <stdarg.h>
#include <math.h>
#include "mArray.h"
#include "RunTime.h"
template <class T>
void qsort(mArray<T> &a) {
long len = a.size();
if (len <= 1) return;