Skip to content

Instantly share code, notes, and snippets.

@sciolist
sciolist / example.rb
Created August 16, 2012 20:46
Use some simple ngrams to figure out what method you wanted to call!
require './oh_god_why'
class Object
include FigureItOut
end
str = "hello, world."
puts str.make_upper_case # HELLO, WORLD.
this = "this be some text"
@sciolist
sciolist / main.c
Created August 5, 2012 14:09
A little method builder
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
#include <limits.h>
#ifndef PAGESIZE
#define PAGESIZE 4096
#endif
@sciolist
sciolist / waffles.html
Created March 15, 2012 16:05
Waffles tests
<!DOCTYPE html>
<html>
<head>
<title>Testing</title>
<base href="https://raw.github.com/sciolist/waffles.js/master/www/">
<script type="text/javascript" src="coffee-script.js"></script>
<script type="text/javascript" src="../out/waffles.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="scrolls.js"></script>
<script type="text/javascript" src="tableview.js"></script>
@sciolist
sciolist / class.js
Created May 10, 2011 23:57
Minimal JavaScript inheritance
function Class() { }
Class.extend = function(data) {
var cls = data.init || function(){};
cls.base = data.__proto__ = this.prototype;
cls.extend = arguments.callee;
cls.prototype = data;
return cls;
};
@sciolist
sciolist / karusell.css
Created April 5, 2011 16:48
Simple jQuery element carousel.
.karusell {
position: relative;
overflow: hidden;
}
.karusell .page.next { z-index: 3; }
.karusell .page.current { z-index: 2; }
.karusell .page {
position: absolute;
background: black;
@sciolist
sciolist / NPocoFaceting.cs
Created September 18, 2015 17:39
Awful faceting with NPoco and SQL Server 2012
using NPoco;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace NPocoFaceting
{
public class FacetBuilder
{
import flash.events.TimerEvent;
class TimerInfo
{
public function new(toInvoke, block)
{
invoke = toInvoke;
blocking = block;
}
@sciolist
sciolist / WKWebView+HideInputAccessoryView.h
Created July 10, 2015 10:26
WKWebView+HideInputAccessoryView
#include <WebKit/WebKit.h>
@interface WKWebView (HideInputAccessoryView)
- (void) setAccessoryViewEnabled:(BOOL)on;
@end
@sciolist
sciolist / alert.js
Created September 11, 2014 21:32
jQuery.feature
(function ($, window, undefined) {
"use strict";
$.feature('js-alert', function (el, value) {
$(el).click(function () { alert(value); });
});
})(jQuery, window);