Skip to content

Instantly share code, notes, and snippets.

💅
startuppin'

Ricardo Torres rictorres

💅
startuppin'
Block or report user

Report or block rictorres

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
@rictorres
rictorres / check-deps.js
Created Mar 1, 2019
check deps ("success" exit code)
View check-deps.js
const npmCheck = require('npm-check')
const chalk = require('chalk')
const stripAnsi = require('strip-ansi')
const _flatten = require('lodash.flatten')
const _compact = require('lodash.compact')
const table = require('text-table')
const emoji = require('node-emoji')
function uppercaseFirstLetter(str) {
return str[0].toUpperCase() + str.substr(1)
View javascript-to-rust-cheat-sheet.md

JavaScript to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in JavaScript and Rust so that programmers most comfortable with JavaScript can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

JavaScript:

@rictorres
rictorres / letsencrypt_2018.md
Created Jun 18, 2018 — forked from cecilemuller/letsencrypt_2019.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2018.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

View safe-string-compare.js
'use strict'
const crypto = require('crypto')
/**
* Do a constant time string comparison. Always compare the complete strings
* against each other to get a constant time. This method does not short-cut
* if the two string's length differs.
*
* @param {string} a
@rictorres
rictorres / free-ssl.md
Last active Apr 14, 2017
getting ssl with certbot
View free-ssl.md

Free SSL with Certbot on Ubuntu

1. install certbot

sudo add-apt-repository ppa:certbot/certbot

2. obtain a cert

certbot certonly --standalone --email EMAIL -d example.com -d www.example.com
@rictorres
rictorres / composition.js
Created Sep 19, 2016
Inheritance vs. Composition
View composition.js
/**
* position trait
*/
const position = (state) => ({
setPosition (x, y) {
state.x = x
state.y = y
}
})
View Preferences.sublime-settings.json
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": false,
"file_exclude_patterns":
[
".DS_Store",
View random-data.js
// go to http://marak.com/faker.js/
var employees = [];
for (var i = 1; i <= 50; i++) {
var firstName = faker.name.firstName();
var lastName = faker.name.lastName();
employees.push({
id: i,
@rictorres
rictorres / jobs.js
Created Oct 6, 2015 — forked from maximilianschmitt/jobs.js
Automated MySQL backups to S3 with node.js
View jobs.js
'use strict';
var mysqlBackup = require('./mysql-backup');
var schedule = require('node-schedule');
schedule.scheduleJob({ hour: 22, minute: 0 }, mysqlBackup);
You can’t perform that action at this time.