Skip to content

Instantly share code, notes, and snippets.

Pablo Cantero phstc

Block or report user

Report or block phstc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View notify-site-is-down.rb
# /usr/bin/notify-site-is-down.rb
require "rubygems"
require "twilio-ruby"
account_sid = ENV["TWILIO_ACCOUNT_SID"]
auth_token = ENV["TWILIO_AUTH_TOKEN"]
@client = account_sid, auth_token
phstc /
Last active Sep 15, 2019
K6 GitHub action

Run k6 for all branches prefixed with k6/, i.e. k6/my-test

phstc / happy_oop.rb
Created Oct 26, 2010
Happy OOP examples using Ruby
View happy_oop.rb
#These Ruby OOP examples, are based on the Rails 3 presentation by @guilhermecaelum
class Person
#the attribute name is immutable
def initialize(name)
@name = name
def name
phstc /
Last active May 20, 2019
Browse a GitHub pull request based on the branch name
  1. download gpr into ~/bin
  2. change org and repo in the script
  3. chmod +x ~/bin/gpr
  4. edit ~/.zshrc adding export PATH="$HOME/bin:$PATH"
  5. cd your-cloned-dir then gpr
phstc / pageChangesNotifier.js
Created Dec 22, 2010
Use this Bookmarklet to start monitoring a page for changes. When a page change is detected you will receive an alert notifying the changes
View pageChangesNotifier.js
/*@author Pablo Cantero -*/
var xmlHttp = getXMLHttpObj();
if(xmlHttp == null){
alert('Failed to load XMLHTTP');
var actual = getPageContent(xmlHttp, window.location.href);
var intervalId = window.setInterval(function(){
var current = getPageContent(xmlHttp, window.location.href);
phstc / create-users.ts
Last active Dec 19, 2018
aws-cdk script for provisioning users + s3 buckets
View create-users.ts
For deploying it:
Install aws-cdk: then
npm run build
cdk deploy
import cdk = require('@aws-cdk/cdk')
phstc / test_mijoes.html
Created Feb 15, 2011
Coding Dojo de Python no Google SP 10/02/2011 / Versão em Javascript.
View test_mijoes.html
<script src=""></script>
<link rel="stylesheet" href="" type="text/css" media="screen" />
Problema: Mijões
Objetivo dados X mictórios e Y mijões, retorne um array contendo VAZIO e MIJAO.
Sendo que os mijões devem ser alocados de forma mais distante possível.
# Some things taken from here
# Set the colours you can use
View app
# /etc/nginx/sites-available/app
upstream app_server {
server unix:/tmp/.unicorn_app.sock fail_timeout=0;
server {
listen 80;
View Rakefile
require 'rubygems'
require 'rake'
require 'rake/testtask'
require File.expand_path('../lib/mongomapper_id2/version', __FILE__) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/{functional,unit}/**/*_test.rb'
You can’t perform that action at this time.