Skip to content

Instantly share code, notes, and snippets.

@kizzx2
kizzx2 / build.gradle
Last active August 29, 2015 13:56
Using Gradle to handle dependencies for (Ant based) Android projects
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
// Define your dependencies here
compile 'com.google.guava:guava:16.0.1'
}
apply plugin: 'java'
repositories {
mavenCentral()
}
configurations {
apt
}
@kizzx2
kizzx2 / test.rb
Created May 10, 2014 05:09
Run single test with Spring in Rails 4.1
require 'optparse'
$: << Rails.root.join('test')
options = {}
OptionParser.new do |opts|
opts.on('-n TEST_NAME') do |n|
options[:test_name] = n
end
opts.on('-e ENVIRONMENT') do |e|

Keybase proof

I hereby claim:

  • I am kizzx2 on github.
  • I am kizzx2 (https://keybase.io/kizzx2) on keybase.
  • I have a public key whose fingerprint is C0CD 8083 90F9 F949 183D 9341 B81F 73A5 E3FD 582F

To claim this, I am signing this object:

@kizzx2
kizzx2 / package.json
Created June 30, 2015 18:35
Simple node-http-proxy with HTTPS
{
"name": "node-https-proxy",
"version": "1.0.0",
"description": "",
"main": "auth.js",
"scripts": {
"start": "node_modules/LiveScript/bin/lsc server.ls"
},
"dependencies": {
"LiveScript": "^1.3.1",
@kizzx2
kizzx2 / c++_compile_time_strlen.cpp
Created April 20, 2011 16:26
Compile time (static) length of string literal
#include <iostream>
template <size_t N>
inline void foo(const char (&)[N])
{
std::cout << "strlen(x) = " << N << std::endl;
}
int main()
{
@kizzx2
kizzx2 / bare_opengl_es.m
Created April 20, 2011 16:20
Barebone OpenGL ES initialization with iOS
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
@interface OGLESView : UIView {
EAGLContext * glContext;
GLuint framebuffer;
GLuint renderbuffer;
}
@kizzx2
kizzx2 / c++_has_function.cpp
Created April 20, 2011 16:27
C++ static "has_function" with SFINAE
#include <iostream>
struct Foo
{
void One();
};
struct Baz : Foo
{
void Two();
@kizzx2
kizzx2 / K2WordNumber.hs
Created August 9, 2011 14:55
Word Numbers brute force (Haskell profiling exercise)
-- Problem: Find the 51000000000-th character of the string (wordNumber Infinity)
-- where a wordNumber is defined as
--
-- wordNumber 1 = "one"
-- wordNumber 2 = "onetwo"
-- wordNumber 3 = "onetwothree"
-- wordNumber 15 = "onetwothreefourfivesixseveneightnineteneleventwelvethirteenfourteenfifteen"
-- ...
--
-- The answer should be presented as ( sum of all numbers up to that point
@kizzx2
kizzx2 / FunDep.hs
Created September 3, 2011 03:24
Haskell type-level programming using functional dependencies and type families
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
-- Type-level functions using functional dependencies