Skip to content

Instantly share code, notes, and snippets.

View rictorres's full-sized avatar
💅
startuppin'

Ricardo Torres rictorres

💅
startuppin'
View GitHub Profile
@rictorres
rictorres / jobs.js
Created October 6, 2015 16:29 — forked from maximilianschmitt/jobs.js
Automated MySQL backups to S3 with node.js
'use strict';
var mysqlBackup = require('./mysql-backup');
var schedule = require('node-schedule');
schedule.scheduleJob({ hour: 22, minute: 0 }, mysqlBackup);
@rictorres
rictorres / gist:ca9168b5b52dc6db002f
Last active September 18, 2015 20:52 — forked from wetzler/gist:4478332
Kickfolio's (minified) code to embed Keen IO charts in their user dashboards. They have 3 line charts (last 7 days, last 24 hours, and last 4 weeks) which show the number of user "connect" sessions for a given app (identified by the filter app.PublicKey). For more context, see this blog post: http://blog.keen.io/post/39950174904/kickfolio-uses-k…
Keen.configure(window.ENV.keenProjectId,window.ENV.keenApiKey),
Keen.onChartsReady(function(){
var e=new Keen.Series("connect",{
analysisType:"count",
timeframe:"last_7_days",
interval:"daily"
}),
t=new Keen.Series("connect",{
@rictorres
rictorres / maintenance-mode.conf
Created September 11, 2015 10:26
nginx maintenance mode
server {
listen 80;
server_name mysite.com;
root /var/www/mysite.com/;
location / {
if (-f $document_root/maintenance.html) {
return 503;
}
... # the rest of your config goes here
@rictorres
rictorres / vps-test-dd.md
Last active March 2, 2020 05:04
VPS performance tests

Using dd

RunAbove Sandbox [ra]

  • 1 core / 2 GB RAM / 20 GB SSD

EC2 Micro [ec]

  • 1 core / 1 GB RAM / 8 GB

Digital Ocean [do]

  • 1 core / 512 MB RAM / 20 GB SSD
@rictorres
rictorres / angular-material.md
Last active August 29, 2015 14:21
List of Angular Material changes (breaking/features) since v0.8.3

0.9.0 (2015-05-04)

Features

  • autocomplete: adds support for messages to be displayed when no results are found (e057e271, closes #2574, #1525)

Breaking Changes

  • styles: removes global line-height and font-size from html and body (666e3311)
  • icons: namespaces built-in icons (539ec5e3)

Keybase proof

I hereby claim:

  • I am rictorres on github.
  • I am rictorres (https://keybase.io/rictorres) on keybase.
  • I have a public key whose fingerprint is 353B A4A8 924A 2B4C A650 06B5 9684 8B0B FFC7 C82D

To claim this, I am signing this object:

io.js Semana de 1 de Maio

Release candidate do io.js 2.0, atualizações da comunidade e eventos

Release candidate do io.js 2.0

Essa semana tivemos um lançamento nightly v2.0, changelog completo poderá ser encontrado em breve no GitHub.

Atualizações da Comunidade

function testWepP(callback) {
var webP = new Image();
webP.src = 'data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMw' +
'AgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA';
webP.onload = webP.onerror = function () {
callback(webP.height === 2);
};
};
testWebP(function(supported) {
'use strict';
const mysql = require('mysql');
const Prom = require('bluebird');
Prom.promisifyAll(require('mysql/lib/Connection').prototype);
Prom.promisifyAll(require('mysql/lib/Pool').prototype);
let pool = mysql.createPool({
host: 'localhost',