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;
#!/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 |
(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) |
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 |
{ | |
"config": { | |
"chainId": 101, | |
"homesteadBlock": 0, | |
"eip155Block": 0, | |
"eip158Block": 0 | |
}, | |
"alloc" : {}, | |
"coinbase" : "0x0000000000000000000000000000000000000000", |
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" }, |
# Example Dockerfile | |
FROM hello-world |
/** | |
* 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 |
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, |
Get a speedcube, they're way more fun. Do not buy original Rubiks cube brand.
Start with the "Beginners Method". Like anything, you might have to try a few different resources before you "get it".