Skip to content

Instantly share code, notes, and snippets.

Chris Yuen kizzx2

Block or report user

Report or block kizzx2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kizzx2
kizzx2 / build.gradle
Last active Aug 29, 2015
Using Gradle to handle dependencies for (Ant based) Android projects
View build.gradle
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
// Define your dependencies here
compile 'com.google.guava:guava:16.0.1'
}
View build.gradle
apply plugin: 'java'
repositories {
mavenCentral()
}
configurations {
apt
}
@kizzx2
kizzx2 / test.rb
Created May 10, 2014
Run single test with Spring in Rails 4.1
View test.rb
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|
View keybase.md

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 Jun 30, 2015
Simple node-http-proxy with HTTPS
View package.json
{
"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 Apr 20, 2011
Compile time (static) length of string literal
View c++_compile_time_strlen.cpp
#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 Apr 20, 2011
Barebone OpenGL ES initialization with iOS
View bare_opengl_es.m
#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 Apr 20, 2011
C++ static "has_function" with SFINAE
View c++_has_function.cpp
#include <iostream>
struct Foo
{
void One();
};
struct Baz : Foo
{
void Two();
@kizzx2
kizzx2 / c++_has_member.cpp
Created Apr 20, 2011
C++ compile time detection of member variable with SFINAE
View c++_has_member.cpp
#include <iostream>
struct Foo
{
int one;
};
struct Bar
{
char one;
@kizzx2
kizzx2 / K2WordNumber.hs
Created Aug 9, 2011
Word Numbers brute force (Haskell profiling exercise)
View K2WordNumber.hs
-- 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
You can’t perform that action at this time.