Skip to content

Instantly share code, notes, and snippets.

View sescobb27's full-sized avatar
🇨🇴
sisas parce

Simon Escobar Benitez sescobb27

🇨🇴
sisas parce
View GitHub Profile
@sescobb27
sescobb27 / bytesreader.go
Last active August 29, 2015 14:20 — forked from rodaine/bytesreader.go
Code snippets for the blog post "Asynchronously Split an io.Reader in Go" (http://rodaine.com/2015/04/async-split-io-reader-in-golang/)
func handleUpload(u io.Reader) (err error) {
// capture all bytes from upload
b, err := ioutil.ReadAll(u)
if err != nil {
return
}
// wrap the bytes in a ReadSeeker
r := bytes.NewReader(b)
@sescobb27
sescobb27 / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
# spec/factories/categories.rb
require 'ffaker'
FactoryGirl.define do
factory :category do
name { Category::CATEGORIES.sample }
description FFaker::Lorem.sentences
end
end
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
http://support.godaddy.com/help/article/3601/generating-a-certificate-signing-request-nginx
http://support.godaddy.com/help/article/4976/rekeying-an-ssl-certificate
# Be sure to remember to chain them!
cat gd_bundle-g2-g1.crt >> yourdomain.crt
# Move 'em
sudo mv yourdomain.crt /etc/ssl/certs/yourdomain.crt
@sescobb27
sescobb27 / knuth.go
Last active August 29, 2015 14:21 — forked from quux00/knuth.go
// implements Knuth or Fisher-Yates shuffle
package knuth
import (
"math/rand"
"time"
)
func init() {
rand.Seed(time.Now().UTC().UnixNano())
package main
import (
"container/list"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
puts 'Welcome to RailsGirls Medellin!!!!'
# types
# - String
# - Boolean
# - Integer
# - Float
# - Array
# - Hash
a_string = "Hola"
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

module A
def a1
end
def a2
end
end
module B
def b1
end
def b2
// /store/route.js
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
var orderOptions = {
type: 'subscription',
status: '13'
};