2015.10.07 t
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
" ________ | |
" | | | |
" | CVIMRC | | |
" |________| | |
" ,----------, | |
" | settings | | |
" '----------' | |
set localconfig |
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
import r2 from '@mcro/r2' | |
import puppeteer from 'puppeteer' | |
import * as _ from 'lodash' | |
const sleep = ms => new Promise(res => setTimeout(res, ms)) | |
const onFocus = page => { | |
return page.evaluate(() => { | |
return new Promise(res => { | |
if (document.hasFocus()) { | |
res() |
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
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
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 | |
# Here short description of this script | |
# This is just a template to be used for writing new bash scripts | |
### | |
# Based on Google Style Guide: https://google.github.io/styleguide/shell.xml | |
# General remarks | |
# * Executables should have no extension (strongly preferred) or a .sh extension. | |
# * Libraries must have a .sh extension and should not be executable |
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
(function() { | |
function hideEverythingAround($el) { | |
const $parent = $el.parentElement; | |
$parent.style.transition = 'background-color 150ms ease-in'; | |
$parent.style.backgroundColor = 'white'; | |
$parent.childNodes.forEach($child => { | |
if($child !== $el && $child.style) { |
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
cd ~/Library/Containers/com.docker.docker/Data/database/ | |
git reset --hard | |
cat com.docker.driver.amd64-linux/disk/full-sync-on-flush | |
# if you see true, continue | |
echo false > com.docker.driver.amd64-linux/disk/full-sync-on-flush | |
cat com.docker.driver.amd64-linux/disk/full-sync-on-flush | |
# you should now see false | |
git add com.docker.driver.amd64-linux/disk/full-sync-on-flush | |
git commit -s -m "Disable flushing" | |
# wait for docker to restart |
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
license: mit |
It's a common confusion about terminal colours... Actually we have this:
- plain ascii
- ansi escape codes (16 colour codes with bold/italic and background)
- 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
- 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
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
-- Functions to create and draw histograms with PostgreSQL. | |
-- | |
-- psql# WITH email_lengths AS ( | |
-- -# SELECT length(email) AS length | |
-- -# FROM auth_user | |
-- -# LIMIT 100 | |
-- -# ) | |
-- -# SELECT * FROM show_histogram((SELECT histogram(length, 0, 32, 6) FROM email_lengths)) | |
-- bucket | range | count | bar | cumbar | cumsum | cumpct | |
-- --------+-------------------------------------+-------+--------------------------------+--------------------------------+--------+------------------------ |
NewerOlder