Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Murray jashmenn

View GitHub Profile
View gist:5328940
/*
** Copyright (c) 2012, Romain Dura romain@shazbits.com
**
** Permission to use, copy, modify, and/or distribute this software for any
** purpose with or without fee is hereby granted, provided that the above
** copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
@jashmenn
jashmenn / final-cut-it-out.js
Created Sep 21, 2017
Remove Silence from Final Cut Pro clips, automatically, using ffmpeg timecodes and OSX JavaScript Automation - Demo: https://imgur.com/a/Zisav
View final-cut-it-out.js
#!/usr/bin/env osascript -l JavaScript
/**
* Delete silence from Final Cut Pro timeline using a script.
* Demo: https://imgur.com/a/Zisav
*
* This script accepts an ffmpeg silencedetect log as input.
*
* To setup, have fcp running along with your clip selected. Ensure that the
* timecode will start at zero before running this script. That is, if your clip
@jashmenn
jashmenn / self-eq-this-vs-bind.md
Last active Nov 1, 2020
Javascript var self = this; vs. .bind
View self-eq-this-vs-bind.md

The Problem

In Javascript this is bound in unexpected ways. Functions, in particular, create a new 'this' and so when you want to keep a reference to an "outer" object you sometimes see the pattern:

var self = this;

as in:

var self = this;
@jashmenn
jashmenn / dynamic_forms_builder.sql
Created Aug 19, 2020 — forked from firmanelhakim/dynamic_forms_builder.sql
Dynamic Forms Builder using PostgreSQL
View dynamic_forms_builder.sql
CREATE TABLE master.forms
(
form_id serial NOT NULL,
code CHARACTER VARYING,
name CHARACTER VARYING,
description CHARACTER VARYING,
properties jsonb,
audit_trails jsonb,
stereotype CHARACTER VARYING,
sort_order INTEGER,
View rubiks-cube.md

Cubes:

Get a speedcube, they're way more fun. Do not buy original Rubiks cube brand.

Learning

Start with the "Beginners Method". Like anything, you might have to try a few different resources before you "get it".

@jashmenn
jashmenn / ej-autocomplete.el
Created Jan 17, 2012
emacs autocomplete w/ hippie-expand and yasnippets
View ej-autocomplete.el
(require 'popup)
(require 'pos-tip)
(require 'popup-kill-ring)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories (concat libfiles-dir "/ac-dict"))
(ac-config-default)
(setq ac-use-menu-map t)
(define-key ac-menu-map (kbd "ESC") 'viper-exit-popup-menu)
(define-key ac-complete-mode-map (kbd "ESC") 'viper-exit-popup-menu)
@jashmenn
jashmenn / s3-upload-node.js
Created Mar 23, 2020
Simple example of uploading to S3 from the filesystem with Node.js - If you're trying to learn how to do this, checkout Fullstack Node.js https://newline.co/fullstack-nodejs
View s3-upload-node.js
const fs = require('fs')
const AWS = require('aws-sdk')
const { promisify } = require('util')
const s3 = new AWS.S3()
s3.uploadP = promisify(s3.upload)
const params = {
Bucket: 'fullstack-printshop',
Key: 'profile-photos/thedude.jpg',
Body: fs.createReadStream('thedude.jpg')
}
@jashmenn
jashmenn / generatePath.js
Last active Mar 6, 2020
Deconstruction of the curves on @Wattenberger's Thinking in Hooks Post
View generatePath.js
// This code is from: https://github.com/Wattenberger/Wattenberger-2019/blob/07024a820011988f5fbefed21161b1111f38e710/src/components/Blog/posts/Hooks/Hooks.jsx#L451-L470
// It generates the SVG path for the curve between two lines on the post "Thinking in React Hooks", located here: https://wattenberger.com/blog/react-hooks
//
// It's a good idea to pull up the documentation on SVG paths here: https://www.w3.org/TR/SVG/paths.html
//
// As you may know, SVG paths are specified by a string where a
// letter is the "command" and the numbers following are the "arguments"
//
// We'll be using 4 commands:
//
View signdemo.txt
FROM: https://people.xiph.org/~greg/signdemo.txt
With Bitcoin 0.7 it's possible to keep your private keys
entirely offline without third party software.
In this example we have two hosts [offline] which is
totally offline and without a copy of the blockchain
and [online] which is a regular online node, both
running bitcoin 0.7.
@jashmenn
jashmenn / irbrc.rb
Created Jun 26, 2013
put in ~/.irbrc
View irbrc.rb
# vim: set ft=ruby
#
# Nate Murray's ~/.irbrc
#
# Can be found at:
# http://gist.github.com/6626
# git clone git://gist.github.com/6626.git gist-6626
#
# Include colorization
require 'rubygems'
You can’t perform that action at this time.