Skip to content

Instantly share code, notes, and snippets.

View jonataswalker's full-sized avatar
💭
I may be slow to respond.

Jonatas Walker jonataswalker

💭
I may be slow to respond.
View GitHub Profile
@jonataswalker
jonataswalker / my-mailer.js
Last active February 16, 2020 07:25
Sending mail with Gmail (XOAuth2) and Nodemailer
'use strict';
var xoauth2 = require('xoauth2');
var nodemailer = require('nodemailer');
var smtp = require('nodemailer-smtp-transport');
var htmlToText = require('nodemailer-html-to-text').htmlToText;
// Sending mail with Gmail using XOAuth2
// http://masashi-k.blogspot.com.br/2013/06/sending-mail-with-gmail-using-xoauth2.html
@jonataswalker
jonataswalker / object-watch.js
Created November 25, 2015 18:33 — forked from flackjap/object-watch.js
Fork of object.watch polyfill in ES5. Modified to not react when the value set is the same as previous.
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
*
* Modified by Nenad Damnjanović
* Nov 9, 2014
@jonataswalker
jonataswalker / Makefile
Last active February 17, 2016 13:12
A build process to a HTML/JavaScript/CSS project.
INDEX_DIR := /home/www/project-foo
BUILD_DIR := $(INDEX_DIR)/build
JS_DEBUG := $(BUILD_DIR)/app-debug.js
JS_FINAL := $(BUILD_DIR)/app.js
CSS_COMBINED := $(BUILD_DIR)/app-combined.css
CSS_FINAL := $(BUILD_DIR)/app.css
# src files
JS_FILES := wrapper-head.js \
utils.js \
app.js \
@jonataswalker
jonataswalker / readme.md
Created November 8, 2015 19:26 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@jonataswalker
jonataswalker / README.md
Created October 13, 2015 11:39 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@jonataswalker
jonataswalker / README.md
Last active September 18, 2015 09:37 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

/*jslint continue:true*/
/**
* Adapted from {@link http://www.bulgaria-web-developers.com/projects/javascript/serialize/}
* Changes:
* Ensures proper URL encoding of name as well as value
* Preserves element order
* XHTML and JSLint-friendly
* Disallows disabled form elements and reset buttons as per HTML4 [successful controls]{@link http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2}
* (as used in jQuery). Note: This does not serialize <object>
* elements (even those without a declare attribute) or
@jonataswalker
jonataswalker / scrape.js
Last active August 31, 2015 14:55 — forked from alexmcpherson/scrape.js
Casper.js vimrc scraper
var casper = require("casper").create();
var url = "https://github.com/search?langOverride=VimL&language=&q=vimrc&repo=&type=Repositories&start_value=" + casper.cli.get(0);
var repoLinks = [];
var fileLinks = [];
function getRepoLinks() {
var links = [];
$("div.results .result h2 a").each(function(i,el){
links.push(el.href);
});
@jonataswalker
jonataswalker / autopgsqlbackup
Last active August 31, 2015 14:51 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@jonataswalker
jonataswalker / markdown.css
Last active August 31, 2015 14:45 — forked from imjasonh/markdown.css
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}