Skip to content

Instantly share code, notes, and snippets.


Matt Machuga machuga

View GitHub Profile
machuga / callback-purgatory-0.js
Last active Mar 22, 2019
Grokkable Concurrent JavaScript - Teaching Asynchronous Patterns and Refactorings
View callback-purgatory-0.js
const get = require('./get'); // get(url, callback)
const githubApi = '';
const githubEventsUrlFor = username => `${githubApi}/users/${username}/events`;
const githubRepoUrlFor = repo => `${githubApi}/repos/${repo}`;
const fetchReposForLatestActivity = (user, callback) => {
let timeout = setTimeout(function() {
callback(new Error('Timed out'));
}, 3000);
machuga / google_analytics_turbolinks5.js
Created May 12, 2017 — forked from Startouf/ google_analytics_turbolinks5.js
Google Analytics for Turbolinks 5 (& Rails 5)
View google_analytics_turbolinks5.js
// Google Analytics code to work with Turbolniks 5
this.GoogleAnalytics = (function() {
function GoogleAnalytics() {}
GoogleAnalytics.load = function() {
var firstScript, ga;
window._gaq = [];
window._gaq.push(["_setAccount", GoogleAnalytics.analyticsId()]);
window._gaq.push(['_setAllowAnchor', true]);
machuga / promise-example.js
Created Nov 18, 2016
Promise Example for Promise Talk
View promise-example.js
const githubApi = '';
const githubEventUrl = githubApi + '/users/machuga/events';
function fetchReposForLatestActivity(user, fn) {
return new Promise(function(resolve, reject) {
machuga / callback-example.js
Last active Nov 18, 2016
Callback Example for Promise Talk
View callback-example.js
const githubApi = '';
const githubEventUrl = githubApi + '/users/machuga/events';
fetchReposForLatestActivity('machuga', console.log);
function fetchReposForLatestActivity(user, fn) {
request(githubEventsUrlFor(user), function(allEvents) {
fetchRepos(getThreeEvents(allEvents), function(rawRepos) {
machuga / index.js
Last active Jan 9, 2016
Express Elm Compilation - basic functionality example. Needs refinement
View index.js
'use strict';
const spawn = require('child_process').spawn;
const express = require('express');
const app = express();
const server = require('http').createServer(app);
const compile = require("node-elm-compiler").compile;
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
machuga / evil-leader.el
Created Oct 6, 2015
Evil Leader config
View evil-leader.el
(evil-leader/set-leader "<SPC>")
"j" 'evil-window-down
"k" 'evil-window-up
"h" 'evil-window-left
"l" 'evil-window-right
"J" 'evil-window-move-very-bottom
"K" 'evil-window-move-very-top
View gist:e58e3b7e1d0cae0d3759
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach-o/dyld.h>
main (int argc, char * argv[])
volatile char * library;
const mach_vm_size_t page_size = getpagesize ();
machuga /
Last active Apr 12, 2021 — forked from radar/
#laravel rules

Asking for help in #laravel on Freenode

Please behave in a polite, considerate, and inclusive manner in the channel at all times. People volunteer their time in the channel to help people like you with your Laravel problems and some respect (in both directions) will go an extremely long way.

When asking questions in the #laravel channel, please follow these 12 simple rules.

  1. Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If it's a concept you're confused about, first check out our Official Documentation. If you're using a method in Laravel, you can look it up in the API Docs.
  2. If you've tried Googling, explain what terms you've tried to use so people can better help you.
  3. Clearly explain what is happening and create a Paste (, (, or ( to better explain yourself
  4. **Do not use any paste service that is no
machuga / Gemfile
Last active Dec 14, 2015
Guard for Jasmine CLI tests
View Gemfile
source :rubygems
gem 'guard'
gem 'guard-shell'
gem 'rb-fsevent', :require => false
gem 'terminal-notifier-guard' # This will use OSX native notifications
machuga / .vimrc
Created Jul 13, 2012
Vimrc file 07-13-2012
View .vimrc
set nocompatible
set number
set ruler
syntax on
" Set encoding
set encoding=utf-8
" Whitespace stuff