Skip to content

Instantly share code, notes, and snippets.

View drewdaemon's full-sized avatar

Drew Tate drewdaemon

  • Elastic
View GitHub Profile
@imryanjay
imryanjay / getHBValues.js
Last active May 16, 2022 00:19
Function to get handlebar values from a template
import _ from 'lodash';
export const getHBValues = (text) => {
const re = /{{[{]?(.*?)[}]?}}/g;
const tags = [];
let matches;
while (Boolean((matches = re.exec(text)))) {
if (matches) {
tags.push(matches[1]);
}
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active July 28, 2024 11:11
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@jacobvosmaer
jacobvosmaer / gist:3187346
Created July 27, 2012 10:35
Open all files with git merge conflicts in Vim

Open all files with git merge conflicts in MacVim

git diff --name-only | uniq | xargs mvim

When git encounters a merge conflict, e.g. during a rebase, it drops you back into the shell with a dirty working directory. I like this one-liner for opening all files with a merge conflict in MacVim.

Once you're in Vim, you can then switch between the files with :n and :prev, or another favourite: :w | n (save current file and open the next command line-supplied file).

UPDATE: see below for a version that works with real terminal commands.

@hagino3000
hagino3000 / app.js
Created March 14, 2011 21:15
JSON-RPC for node (express)
/**
* Module dependencies.
*/
var express = require('express');
var rpcMethods = require('./methods.js');
var app = module.exports = express.createServer();
// Configuration