Skip to content

Instantly share code, notes, and snippets.

View jalcine's full-sized avatar
💭
Decentralize and democratize the Web.

Jacky Alciné jalcine

💭
Decentralize and democratize the Web.
View GitHub Profile
@karimmtarek
karimmtarek / ruby_interview_questions.md
Last active August 29, 2015 14:18
Interview_Questions_Ruby

#Ruby Interview Questions

What are blocks for?

Plain old english: Ways of grouping code we want to run. The simplest explanation for a block is that it is a chunk of code between {} or do...end, that can't be stored in a variable and isn't an object. A block is just part of the syntax of a method call. It doesn’t mean anything on a standalone basis and can only appear in argument lists.

What are the difference between p and puts?

The difference is subtle, but p prints the true value of an object, rather than a string-ified version of the object. This will make more sense soon, but for the sake of simplicity, we'll use the p command throughout the exercises, as we'll want to see the true values of our code returned to the output window.

@kosamari
kosamari / what-I-learned.md
Created June 15, 2015 13:43
What I learned from reading PRs and issues on 'What is Code?' repo

Programmers likes to fix things. When there is a typo in your code, then your code won't work. There are many requests to fix typo in the article from inconstant numbering in footnotes to wrong filename for images. When spotting someone's mistake, get creative and title your PR like "Instagram is only worth 1 Instragram not 2 Instragrams". Programmer's attention to detail extends not only the article itself, but also the license doc in the repo.

Don't forget to fact check before spotting mistake though. It's important. Keyword to use is AFAIK and can confirm.

Programmers love to know the source of information. There are few requests to add hyperlinks to contents referenced in the article. Some are from original autho

# http://unicorn.bogomips.org/SIGNALS.html
rails_env = ENV['RAILS_ENV'] || 'production'
rails_root = ENV['RAILS_ROOT'] || "/data/github/current"
God.watch do |w|
w.name = "unicorn"
w.interval = 30.seconds # default
# unicorn needs to be run from the rails root
check process unicorn
with pidfile /var/run/unicorn/unicorn.pid
start program = "/etc/init.d/unicorn start"
stop program = "/etc/init.d/unicorn stop"
if mem is greater than 300.0 MB for 1 cycles then restart # eating up memory?
if cpu is greater than 50% for 2 cycles then alert # send an email to admin
if cpu is greater than 80% for 3 cycles then restart # hung process?
group unicorn
@Najaf
Najaf / SECURITY.md
Last active September 10, 2015 19:31

Security inspections

At the beginning of each month, we carry out a brief, high-level security inspection. The purpose is to be a sanity check for head-slapping, trivial vulnerabilities that no one expected would be in the code but somehow managed to creep in anyway.

Who's responsible?

One of @alice, @bob or @charlie should do the inspection if no one else has the time.

How often?

@andrewwoods
andrewwoods / .git-commitmessage
Last active September 18, 2015 21:21
Custom Git Commit Message
Subject line
Describe what you did and why
[ticket: #X]
#------------------------------------------------@----------------------
#
# * Separate subject from body with a blank line
# * Limit the subject line to 50 characters
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
#!/bin/bash
# FLAC encoded example
curl \
--data-binary @example.flac \
--header 'Content-type: audio/x-flac; rate=16000' \
'https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&pfilter=2&lang=en-US&maxresults=6'
# Speex encoded example
curl \
@fennb
fennb / gist:1139053
Created August 11, 2011 07:00
Sample speech recognition output
{
"hypotheses": [
{
"confidence": 0.88569070000000005,
"utterance": "this is pretty cool"
},
{
"utterance": "thesis pretty cool"
},
{
@felipecrv
felipecrv / ct
Created May 11, 2012 04:09
CSS for ctags
--langdef=css \
--langmap=css:.css \
--regex-css='/^[ \t]*\.([A-Za-z0-9_-]+)/#\1/c,class,classes/' \
--regex-css='/^[ \t]*#([A-Za-z0-9_-]+)/.\1/i,id,ids/' \
--regex-css='/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/' \
--regex-css='/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/' \