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
import Ember from "ember";
import startApp from '../../helpers/start-app';
import {textHas, selectFrom} from '../../helpers/util';
import config from '../../../config/environment';
import { module, test } from 'qunit';
import QUnit from 'qunit';
var debug = Ember.Logger.debug;
var apiUrl = config.api.host + config.api.namespace;
var path = '/checkout';
@sescobb27
sescobb27 / id.go
Created July 6, 2015 14:26
generating "sequential" random IDs
package main
import (
"crypto/rand"
"fmt"
"log"
"math/big"
"time"
)
import Ember from 'ember';
var debug = Ember.Logger.debug;
// store/checkout/success
// ember-data 1.0.0-beta.19.1
// ember 1.11.3
export default Ember.Route.extend({
setupController: function (controller) {
debug('finding last successful order');
openssl req -new -newkey rsa:2048 -nodes -out $DOMAIN.csr -keyout $DOMAIN.key -subj "/C=US/ST=$STATE/L=$LOCATION/O=$NAME/OU=$DESC/CN=$URL"
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
@sescobb27
sescobb27 / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@sescobb27
sescobb27 / docker-cleanup
Last active September 5, 2015 03:20 — forked from wdullaer/docker-cleanup
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@sescobb27
sescobb27 / install.sh
Last active September 5, 2015 03:20 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@sescobb27
sescobb27 / maybe.rb
Last active September 5, 2015 20:02 — forked from guilleiguaran/maybe.rb
Maybe Monad
require 'singleton'
class Maybe
def self.unit(value)
if value.nil? || (value.respond_to?(:empty?) && value.empty?)
Nothing.instance
else
Just.new(value)
end
end
@sescobb27
sescobb27 / bench_async_vs_sucker_punch.rb
Created October 5, 2015 06:35
Benchmarking ActiveJob AsyncAdapter vs. SuckerPunchAdapter
#!/usr/bin/env ruby
#####################################################################
#
# Benchmarking ActiveJob AsyncAdapter vs. SuckerPunchAdapter
#
# Copy this file into the `activejob` directory of the Rails git
# project and, optionally, make it executable. Make sure that
# `bundle install` was successfully run on the Rails repo first. Then
# run this file under a bundler context: