Skip to content

Instantly share code, notes, and snippets.

View dillonalynch's full-sized avatar

Dillon Lynch dillonalynch

View GitHub Profile
@sergiors
sergiors / _functions.php
Last active April 17, 2017 05:52
Reduce seu novo melhor amigo (Exemplos PHP)
<?php
function every($fn, $ls)
{
$keys = array_keys($ls);
$params = (new \ReflectionFunction($fn))->getParameters();
return array_reduce($keys, function ($carry, $idx) use ($fn, $ls, $params) {
$args = $ls[$idx];
@ralphschindler
ralphschindler / node_mate.rb
Created October 6, 2013 01:31
Running unsaved JavaScript though Node.js with TextMate 2 Notes: It's basically 2 files, one created with the bundle editor (See the tmCommand), and the actual node runner. This also requires an environment variable to be setup pointing to the node command line utility: TM_NODE=/usr/local/bin/node for node installed via homebrew
require "#{ENV["TM_SUPPORT_PATH"]}/lib/scriptmate"
class NodeScript < UserScript
def lang; "JavaScript" end
def default_extension; ".js" end
def args
[]
end
def executable; @hashbang || ENV['TM_NODE'] || 'node' end
def version_string
@mhawksey
mhawksey / gist:5419995
Created April 19, 2013 12:21
Google Apps Script SuperEventForm
// Available under Creative Commons Attribution-ShareAlike 2.5 UK: Scotland License
// Bashed by mhawksey
var SPREADSHEET_ID = ""; // If using within Google Sites paste the spreadsheet key here (this is everything between key= and &hl in the address bar)
// JavaScript Document
function onOpen() {
if (SPREADSHEET_ID == ""){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Setup", functionName: "setup"}, {name: "Send Booking Confirmations", functionName: "sendBookingConf"}];