Skip to content

Instantly share code, notes, and snippets.

View jashmenn's full-sized avatar

Nate Murray jashmenn

View GitHub Profile
@jashmenn
jashmenn / final-cut-it-out.js
Created September 21, 2017 11:44
Remove Silence from Final Cut Pro clips, automatically, using ffmpeg timecodes and OSX JavaScript Automation - Demo: https://imgur.com/a/Zisav
#!/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
{
"config": {
"chainId": 101,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
@jashmenn
jashmenn / ej-autocomplete.el
Created January 17, 2012 19:12
emacs autocomplete w/ hippie-expand and yasnippets
(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 / self-eq-this-vs-bind.md
Last active September 6, 2022 23:11
Javascript var self = this; vs. .bind

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;
/*
** 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
const fs = require("fs");
const CoinGecko = require("coingecko-api");
const { table } = require("table");
const chalk = require("chalk");
const cg = new CoinGecko();
const coins = [
{ "id": "ethereum", "symbol": "ETH" },
{ "id": "bitcoin", "symbol": "BTC" },
@jashmenn
jashmenn / Dockerfile
Created January 15, 2021 19:46 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@jashmenn
jashmenn / vending-machine-smart-contract.js
Last active December 13, 2020 13:16
Pseudocode for a vending machine "smart contract" in JavaScript
/**
* A pseudo VendingMachine "smart contract" in JavaScript
*
* See: https://newline.co
**/
class VendingMachine {
constructor() {
this.price = 50; // 50 cents for any soda
this.balance = 0; // number of cents paid so far
this.selection = null; // name of selected drink
@jashmenn
jashmenn / dynamic_forms_builder.sql
Created August 19, 2020 15:48 — forked from firmanelhakim/dynamic_forms_builder.sql
Dynamic Forms Builder using PostgreSQL
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,

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".