This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TLC5947 | |
class << self | |
def upscale(i) | |
(i / 255.0 * 4095.0).to_i % 4096 | |
end | |
def compress(data) | |
data.map{|v|upscale(v).to_s(2).rjust(12, '0')}.join.scan(/.{8}/).map{|v|v.to_i(2)} | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
set number | |
set ruler | |
syntax on | |
" Set encoding | |
set encoding=utf-8 | |
" Whitespace stuff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Amadeusz Juskowiak <[email protected]> 2012 - MIT License | |
# 1. Put inside helpers do .. end | |
# 2. Set CACHE_DIR to somewhere writable and private (like CACHE_DIR=File.dirname(__FILE__) + '/tmp' | |
# 3. Use it! You can use fragment_expire to remove cache with given name. | |
# | |
# Example: | |
# %h1 foo | |
# = cache_fragment(:report, 300) do | |
# - data = get_data_slowly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include "timer.h" | |
int main() | |
{ | |
int n, k, x, y, r = 0, mockup = 0; | |
srand(time(0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sinatra" | |
get '/' do | |
'Hello world!' | |
end | |
get '/hello/:name' do | |
"Hello #{params[:name]}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PALETTE pal; | |
PACKFILE *file; | |
/* Open file */ | |
file = pack_fopen(filename, "rb"); | |
if (!file) some_error_func(); | |
/* Read header before palette ... */ | |
/* ... Some header reading code here ;) */ | |
/* Read palette */ | |
pack_fread(&pal, 1024, file); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl "http://api.forismatic.com/api/?method=getQuote&lang=en&format=text" | sed -e 's/(/\ | |
\ | |
/g' | sed -e 's/ )//g' | sed -e 's/)//g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ws = 640; | |
int st = 20; | |
int ed = 1; | |
int sd = 10; | |
void setup() { | |
size (ws, ws); | |
noStroke(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
#define abs(x) (x>0?x:-x) | |
double f(double x) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem list | |
** LOCAL GEMS *** | |
abstract (1.0.0) | |
actionmailer (3.0.0.beta3) | |
actionpack (3.0.0.beta3) | |
activemodel (3.0.0.beta3) | |
activerecord (3.0.0.beta3) | |
activeresource (3.0.0.beta3) | |
activesupport (3.0.0.beta3) |