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
# Everything you need to do to get started with Rails 2.3.8 | |
# | |
# As of June 14th, 2010 @ 2:30 p.m. MST | |
# | |
# This gist now features instructions to get Rails 3 up and running with: | |
# - Ruby 1.8.7-p174 | |
# - Bundler 0.9.26 | |
# - Cucumber 0.8.0 | |
# - Rspec 1.3.0 + Rspec-Rails 1.3.2 | |
# - RVM |
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(slugs). | |
-export([slugify/1]). | |
-define(tolower(C), (C+32)). | |
-define(islower(C), (C >= $a andalso C =< $z)). | |
-define(isupper(C), (C >= $A andalso C =< $Z)). | |
-define(isdigit(C), (C >= $1 andalso C =< $9)). | |
-define(isspace(C), ( | |
C =:= $\s orelse C =:= $\n orelse C =:= $\t orelse C =:= $\r |
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
## MAC OS | |
.DS_Store | |
## TEXTMATE | |
*.tmproj | |
tmtags | |
## EMACS | |
*~ | |
\#* |
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
Building native extensions. This could take a while... | |
ERROR: Error installing memprof: | |
ERROR: Failed to build gem native extension. | |
/home/kavu/.rvm/rubies/ree-1.8.7-2010.02/bin/ruby extconf.rb | |
checking for main() in -lyajl_ext... yes | |
checking for json/json_gen.h... yes | |
checking for gelf_getshdr() in -lelf_ext... yes | |
checking for main() in -ldwarf_ext... yes | |
checking for mach-o/dyld.h... no |
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 <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
static char buf[] = "the world helorow"; | |
static void revstr(char *start, char *end) { | |
register char temp; | |
while(start < end) { | |
temp = *start; |
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
/* | |
Original code: | |
https://github.com/brandon/lucid/blob/master/spec/javascripts/z_jshint_spec.js | |
*/ | |
describe('JSHint', function () { | |
var options = {curly: true, white: true, indent: 2}, | |
files = /^\/src|.*spec\.js$/; | |
function get(path) { |
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 'net/http' | |
require 'json' | |
class Net::HTTP::Patch < Net::HTTPRequest | |
METHOD = 'PATCH' | |
REQUEST_HAS_BODY = true | |
RESPONSE_HAS_BODY = true | |
end | |
url = URI.parse('https://api.github.com/user') |
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
// ПоПацански.cpp : Defines the entry point for the console application. | |
// | |
// #include "stdafx.h" | |
#define подъёбку setlocale | |
#define чуть_чуть 7 | |
#define так_себе 12 | |
#define пошло_оно_всё 120 |
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 'rest_client' | |
require 'json' | |
a = `sox -d --norm -t .flac - silence -l 1 0 1% 1 6.0 1% rate 16k` | |
#a = `arecord -q -d 3 -c 1 -f S16_LE -r 22050 -t wav | flac - -f --totally-silent -o-` | |
r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a, | |
:content_type => 'audio/x-flac; rate=16000' | |
(p j; `espeak 'you said: #{j['hypotheses'].first['utterance']}'`) if (j = JSON.parse(r)) |
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
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, IncoherentInstances #-} | |
class (MyClass t) where | |
doShow :: (Show t) => t -> String | |
instance (MyClass String) where | |
doShow x = "Your string is " ++ x | |
instance (MyClass t) where | |
doShow x = "Your parameter is " ++ show x | |
instance (MyClass [t]) where | |
doShow x = do |