Skip to content

Instantly share code, notes, and snippets.

View jsanta's full-sized avatar

Jose Ignacio Santa Cruz G. jsanta

View GitHub Profile
@MeLlamoPablo
MeLlamoPablo / nvmlink
Created February 1, 2017 11:34
Creates a symlink to /usr/bin/node after using nvm
@jatcwang
jatcwang / gist:ae3b7019f219b8cdc6798329108c9aee
Created February 2, 2017 23:44
List of all setxkbmap configuration options (including models/layout/etc)
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
@bszwej
bszwej / echo.js
Last active April 26, 2024 05:22
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
@trongthanh
trongthanh / gist:2779392
Last active April 24, 2024 23:46
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@bricker
bricker / amznymous.md
Last active April 23, 2024 11:14
An Amazon Programmer's Perspective (http://pastebin.com/BjD84BQ3)

Originally posted at http://pastebin.com/BjD84BQ3

Trigger warning: mention of suicidal ideation

tl;dr: I burned out as a developer at Amazon at the end of my second year. I’ve since found a healthy and sustainable work-life balance and enjoy work again. I write this to A) raise awareness, especially for new-hires and their families, and B) help give hope and advice to people going through the same at Amazon or other companies.

Hello, world

There’s been no shortage of anecdotes, opinions, and rebuttals regarding Amazon’s corporate culture as of late. I write this not to capitalize on the latest news-feed fad, but to share what I had already written and promptly deleted. I didn’t think anyone would want to hear my story, but it’s apparent people are going through a similar experience and don’t have a voice.

I’m a Software Development Engineer II at Amazon; SDE II basically means a software developer with at least 2–3 years of industry experience. I started at Amazon as an SDE I.

@fernospam
fernospam / Amazfit Bip-U.md
Last active April 23, 2024 06:28
How to create watch faces for Amazfit Bip U (also GTR and GTS)

Creación de Esferas para Amazfit Bip U (también GTR y GTS)

A continuación se relata lo mínimo necesario que hay que saber para crear esferas para varios relojes Amazfit. La explicación esta especialmente indicada para el modelo Bip-U, del cual apenas hay nada en internet, pero la mayoría de pasos son aplicables a otros modelos como GTS y GTR en sus distintas variedades, pues se utilizan las mismas herramientas.

Acceso a la app de creación de la esfera

Las esferas de varios modelos de Amazfit utilizan la app para este propósito que se encuentra en la web de Huami (los relojes Xiaomi, Amazfit y Zepp los fabrica Huami).

Primero hay que darse de alta en Huami como developer (descripción en https://amazfitwatchfaces.com/forum/viewtopic.php?t=2090)

@emiller
emiller / git-mv-with-history
Last active April 17, 2024 21:06
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@montanaflynn
montanaflynn / streamer.js
Created January 27, 2015 19:38
Streaming a response with Express.js
var express = require('express')
var app = express()
app.listen(1337)
app.all('/stream/:chunks', function (req, res, next) {
res.writeHead(200, {
'Content-Type': 'text/plain',
@mohanraj-r
mohanraj-r / scp-speed-test.sh
Last active March 5, 2024 10:31
[speed test] Test ssh connection speed
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# http://www.alecjacobson.com/weblog/?p=635
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]