Skip to content

Instantly share code, notes, and snippets.

View afj176's full-sized avatar

Antonio Fernandes afj176

View GitHub Profile
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
-- 1. Create a new generic password entry in Keychain Access called "WHATEVER_AnyConnect_VPN" (the name in Keychain access must match that in line 39 below) with your password for the Cisco AnyConnect VPN server.
-- 2. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility.
-- 4. Enable the above .app so it can access Accessibility
-- 5. Copy and paste a nice icon on the generic Applescript icon (I used a copy of the default AnyConnect one)
-- 6. Add the new .app to /Users/[yourshortname]/Applications with a shortcut to your Dock
-- 7. Enjoy the fast connection with no need to enter password and increased security of not having a sensitive password stored as plain text
-- 8. Run script again to close connection
-- AnyConnect now refered to as targetApp
@afj176
afj176 / image-upload-field-custom-taxonomy
Created March 9, 2016 01:45 — forked from mathetos/image-upload-field-custom-taxonomy
Add Image Upload Field to Custom Taxonomy
<?php
/* Add Image Upload to Series Taxonomy */
// Add Upload fields to "Add New Taxonomy" form
function add_series_image_field() {
// this will add the custom meta field to the add new term page
?>
<div class="form-field">
<label for="series_image"><?php _e( 'Series Image:', 'journey' ); ?></label>
@afj176
afj176 / .npm-init.js
Created February 28, 2016 02:50
example .npm-init.js
var fs = require('fs'),
path = require('path'),
homeDir = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,
gitConfig = path.join(homeDir, '.gitconfig'),
cwd = process.cwd(),
name = cwd.split('/').pop();
/*
decode function and required functions copied from
https://github.com/npm/ini
in order to parse github config without added reqs

26 time management hacks I wish I'd known at 20

  1. There's always time. Time is priorities
  2. Days always fill up | "Only plan for 4-5 hours of real work per day."
  3. Work more when you're in the zone. Relax when you're not. | "It's normal to have days where you just can't work and days where you'll work 12 hours straight"
  4. Respect your time and make it respected | "Your time is $1000/hour, and you need to act accordingly"
  5. Stop multi-tasking. It merely kills your focus.
  6. Set up a work routine and stick to it. Your body will adapt
  7. We're always more focused and productive with limited time.
  8. Work is the best way to get working. Start with short tasks to get the ball rolling.
@afj176
afj176 / designer.html
Created October 23, 2014 04:45
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

@afj176
afj176 / mock-playlist
Created May 30, 2014 06:36
Mock Playlist
"Biggie Smalls feat. Jay-Z" "I Love The Dough" "http://a.tumblr.com/tumblr_lekfx87hTD1qcgewao1.mp3"
"LL Cool J" "Mama-Said-Knock-You-Out" "http://www.clowndrowner.com/wp-content/uploads/2010/07/LL-Cool-J-Mama-Said-Knock-You-Out.mp3"
"OutKast" "ATLiens" "http://n1.vmuzike.net/music/OutKast/ATLiens.mp3"
"Run DMC" "Run's House" "http://chrismorris.ca/clients/frito/RunsHouse.mp3"
"Beastie Boys" "So Watcha Want" "http://fragxperts.com/tunes/4.Beastie%20Boys%20-%20So%20Watcha%20Want.mp3"
@afj176
afj176 / example-from-jquery-vertical-timeline.js
Created March 11, 2014 16:45
example from jquery vertical timeline
/**
*
*
*
*/
(function($) {
"use strict";
var eventPrepData = [{
/**
* Setup Module with `highlight` filter
*/
var JekyllApp = angular.module('JekyllApp', [], function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(false);
});
JekyllApp.filter('highlight', function () {
return function (text, filter) {