Skip to content

Instantly share code, notes, and snippets.

@psahni
psahni / location_map_complex.html
Created September 30, 2011 16:40
location_map_complex.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: Marker Animations Loop</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type='text/javascript'>
// GLOBAL VARIABLES
@thiagoghisi
thiagoghisi / CodingDojo_DicasParaNovosGrupos
Created September 30, 2011 23:24
Tutorial/Dicas para montar um grupo de Coding Dojo na sua região
1ª Criar um grupo de discussão; (Sugestão: Google Groups)
2ª Divulgar o grupo para o pessoal da sua região nas redes socias que você participa;
(Dica: Divulgação no Twitter é essencial)
3ª Fazer um spam para todos os seus contatos da área da sua região convidando para o grupo;
4ª Se você não for muito influente nas redes sociais ou não tiver muitos contatos,
solicitar para alguém que tenha ajudar na divulgação do grupo;
(Dica: O que vale nesse momento é fazer bastante barulho)
@zliang-min
zliang-min / example.rb
Created November 10, 2011 18:30
You don't need a library for everything. For example, git.io :)
Git.io.generate 'https://gist.github.com/gists/1355677'
Git.io.generate 'https://github.com/gimi', 'gimi'
Git.io.recognize 'http://git.io/gimi'
# HOLE 1
#
# Given a number the function returns “Fizz” if it is a multiple of 3,
# “Buzz” if it is a multiple of 5 and “FizzBuzz” if it is a multiple of
# 15. If the number is not a multiple of 3 or 5 then the number is
# returned as a string.
# Original answer
def fizzbuzz( n )
b,m="Buzz",n%5==0;n%3==0?"Fizz#{b if m}":m ?b:n
@rkh
rkh / chat.rb
Created December 14, 2011 12:55
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@alotaiba
alotaiba / google_text2speech.md
Created February 3, 2012 07:31
Google Text to Speech API

Google Text to Speech API

Base URL: http://translate.google.com/translate_tts
It converts written words into audio. It accepts GET requests.

GET

q
The query string to convert to audio

tl
Translation language, for example, ar for Arabic, or en-us for English

@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@harmesy
harmesy / chat.rb
Created April 2, 2012 16:30
Simple EventMachine chat server
#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
class Server
attr_accessor :connections
def initialize
@connections = []
@pmarreck
pmarreck / Ruby.sublime-build
Last active December 10, 2023 20:00
Get Sublime Text 2 (or 3) to use your RVM ruby and bundle Gemfile
# Get Sublime to use your rvm ruby... Change your ~/Library/Application Support/Sublime Text 2/Packages/Ruby/Ruby.sublime-build
# (for ST3: ~/Library/Application Support/Sublime Text 3/Packages/User/Ruby.sublime-build) to this, replacing YOURUSERNAME.
# I am still looking to optimize this further... For example, avoiding hardcoding by using something like $HOME, although
# I have yet to get any form of that to work.
{
"working_dir": "${project_path}",
"cmd": [
"/Users/YOURUSERNAME/.rvm/bin/rvm-auto-ruby", "-Ilib:test", "$file"
],