Skip to content

Instantly share code, notes, and snippets.

View emerson-d-lopes's full-sized avatar
👻

Emerson L. emerson-d-lopes

👻
View GitHub Profile
@bradtraversy
bradtraversy / node_cheerio_scraping.js
Created August 6, 2018 02:55
Simple example to scrape some posts and put into a CSV file using Node & Cheerio
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const writeStream = fs.createWriteStream('post.csv');
// Write Headers
writeStream.write(`Title,Link,Date \n`);
request('http://codedemos.com/sampleblog', (error, response, html) => {
if (!error && response.statusCode == 200) {
@saqueib
saqueib / errorHandler.js
Last active June 9, 2022 06:42
Global error handling using axios interceptor for http calls http://www.qcode.in/api-error-handling-in-vue-with-axios
import axios from 'axios'
import toast from './toast'
function errorResponseHandler(error) {
// check for errorHandle config
if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) {
return Promise.reject(error);
}
// if has response show the error
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active June 5, 2025 15:33
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@DavidWells
DavidWells / reset.css
Last active May 28, 2025 14:19 — forked from karbassi/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@jiglesiasabio
jiglesiasabio / select-lang-codes
Created December 1, 2011 18:36
Select options for all languages HTML·FORM
http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt
ISO-639-2 Standard three letter codes for langs
<option value="aar"> Afar </option>
<option value="abk"> Abkhazian </option>
<option value="ace"> Achinese </option>
<option value="ach"> Acoli </option>
<option value="ada"> Adangme </option>
<option value="ady"> Adyghe Adygei </option>