Skip to content

Instantly share code, notes, and snippets.

View rdiego26's full-sized avatar

Diego Ramos rdiego26

View GitHub Profile
[{url: "https://emoji.slack-edge.com/T6CU2169Z/100sual/b3a1531ff45f2acd.jpg", name: ":100sual:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/1_don%2527t_pick_up_the_phone/8dd1f635352780e8.png", name: ":1_don't_pick_up_the_phone:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/1hokage/9e66cda3a2ecf310.jpg", name: ":1hokage:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/2_don%2527t_let_him_in/eb898e174fa62821.png", name: ":2_don't_let_him_in:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/2hokage/63f4935ed5608b8c.gif", name: ":2hokage:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/3_don%2527t_be_his_friend/68b9721a15ed8aeb.png", name: ":3_don't_be_his_friend:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/3hokage/765b9b0f9d994981.jpg", name: ":3hokage:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/4hokage/39a0745cfb994d6c.jpg", name: ":4hokage:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/5hokage/0e9dcea089de5b8b.jpg", name: ":5hokage:"}
,{url: "https://emoji.slack-edge.com/T6CU2169Z/6hokag
@gokulkrishh
gokulkrishh / media-query.css
Last active June 25, 2025 15:41
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@jaydson
jaydson / async.await.js
Created January 6, 2015 20:27
Testint ES7 async/await
function p1() {
return new Promise(function(resolve, reject){
setTimeout(function() {
resolve('p1');
}, 300);
});
}
function p2() {
return new Promise(function(resolve, reject){
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@fidelisrafael
fidelisrafael / app.js
Last active August 26, 2021 02:15
Easy way to export data to XLS format using Node.js
// clone this gist to a empty folder, the run:
// npm init (and follow steps)
// npm install express --save
// npm install swig --save
// node app.js and open http://localhost:3000
function App() {
var express = require('express');
@branneman
branneman / better-nodejs-require-paths.md
Last active June 24, 2025 22:40
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@joaoneto
joaoneto / correios.js
Last active July 27, 2017 19:28
Track para os correios
var http = require('http');
var parseTrack = function (data) {
var trackLines = data.replace(/[\r\n]/g, '').replace(/<\/tr>/gi, '</tr>\n').match(/<tr.*?>(.*)<\/tr>/gi);
trackLines.shift();
var parsed = [], parts = [];
var length = trackLines.length;
var details, date, track;
while (length--) {
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static