- Set Light mode
defaults write -g NSRequiresAquaSystemAppearance -bool Yes- Log out and log back in
- Set Dark mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $ = require('NodObjC'); | |
| $.import('Cocoa'); | |
| var installNSBundleHook = function() { | |
| var cls = $.NSBundle; | |
| if (cls) { | |
| var bundleIdentifier = cls.getInstanceMethod('bundleIdentifier'); | |
| bundleIdentifier.setImplementation(function(val) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Node-WebKit CheatSheet | |
| # Download: https://github.com/rogerwang/node-webkit#downloads | |
| # Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions | |
| # Wiki: https://github.com/rogerwang/node-webkit/wiki | |
| # How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium | |
| # 1. Run your application. | |
| # https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(function(require) { | |
| var React = require('react'); | |
| var paramRegex = /__(\d)+/; | |
| var parser = new DOMParser(); | |
| var errorDoc = parser.parseFromString('INVALID', 'text/xml'); | |
| var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI; | |
| // turns the array of string parts into a DOM | |
| // throws if the result is an invalid XML document. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Observable is an Union Type, with the following variants | |
| const Empty = () => ['EMPTY'] | |
| const Cons = (head, tail) => ['CONS', head, tail] | |
| const Future = promise => ['FUTURE', promise] | |
| // race between 2 promises; each promise will resolve to a lazy value | |
| const lazyRace = (p1, p2) => Promise.race([p1,p2]).then(lazy => lazy()) | |
| // function composition | |
| const compose = (...fns) => (arg) => fns.reduceRight((res, f) => f(res), arg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Full command line options | |
| ``` | |
| ffmpeg -f gif -i FOO.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' BAR.mp4 | |
| ``` | |
| ### Notie | |
| * output mp4 is encoded with h264, support Firefox/Chrome/Safari in Windows, Mac OSX, Android, and iOS. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| elm-stuff/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -i input.aiff -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 output.mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function (user, context, callback) { | |
| user.app_metadata = user.app_metadata || {}; | |
| if ('stripe_customer_id' in user.app_metadata) { | |
| context.idToken['https://example.com/stripe_customer_id'] = user.app_metadata.stripe_customer_id; | |
| return callback(null, user, context); | |
| } | |
| var stripe = require('stripe')('sk_....'); | |
| var customer = { |