This file contains 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
// Slate is here: https://github.com/jigish/slate/ | |
// Widths for frontend development | |
var pushToScreenWidth = slate.operation("move", { | |
"x": "screenOriginX", | |
"y": "screenOriginY", | |
"width": "screenSizeX", | |
"height": "screenSizeY" | |
}); | |
// dup duplicates the operation and changes the given parameters |
This file contains 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
# Dependencies: | |
# - Bucklescript: https://bucklescript.github.io/en/ | |
# - entr for watching file changes: http://entrproject.org/ | |
# Source this file in your bashrc (or other shell) to have the command available | |
# Set your $EDITOR environment variable to the editor of your choice. | |
# To use: $ reasonstart my-new-project | |
# This will create and start the new project on the given location. | |
function reasonstart () { | |
bsb -init $1 -theme basic-reason && | |
cd $1 && |
This file contains 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
# Tested on macOS Mojave. | |
# Depending on your language settings you may need to change "greyscale" to "grayscale". | |
tell application "System Preferences" | |
activate | |
reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess" | |
end tell | |
tell application "System Events" to tell process "System Preferences" | |
repeat until exists of checkbox "Use greyscale" of group 1 of window "Accessibility" |
This file contains 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
const getRandomTimeOutInMs = () => Math.floor(Math.random() * 5000); | |
const apis = ["Facebook", "Twitter", "Instagram"]; | |
const start = () => { | |
apis.forEach(api => { | |
let currentApi = new Promise(function(resolve, reject) { | |
let timeout = getRandomTimeOutInMs(); | |
setTimeout(() => { | |
resolve(`The ${api} API took ${timeout} ms to respond.`); |
This file contains 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
I pinpointed the source down to this Firefox extension: https://addons.mozilla.org/en-US/firefox/addon/dark-mode-zen/ |
This file contains 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
#!/bin/bash | |
# set -Eeuo pipefail | |
# Splits video to separate scenes files | |
# Source: https://gist.github.com/achesco/4dc2ebf13378a0a61fc26c7fe01f539e | |
# Inspired by https://stackoverflow.com/a/38205105 | |
# The "-c:v h264_videotoolbox \" argument makes it work faster on Apple Silicon | |
# computers. | |
# ❗The bitrate argument is overriden in this version, we look at the original bitrate. |
This file contains 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
-- Filters function names from extensions: postgis, btree_gist, fuzzystrmatch | |
with function_names (name) as (SELECT | |
p.proname as function_name | |
FROM | |
pg_catalog.pg_extension AS e | |
INNER JOIN pg_catalog.pg_depend AS d ON (d.refobjid = e.oid) | |
INNER JOIN pg_catalog.pg_proc AS p ON (p.oid = d.objid) | |
INNER JOIN pg_catalog.pg_namespace AS ne ON (ne.oid = e.extnamespace) | |
INNER JOIN pg_catalog.pg_namespace AS np ON (np.oid = p.pronamespace) | |
WHERE |
This file contains 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
with function_names (name) as ( | |
SELECT | |
p.proname AS function_name | |
FROM | |
pg_proc p | |
LEFT JOIN | |
pg_depend d ON d.objid = p.oid | |
AND | |
d.deptype = 'e' | |
WHERE |