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
// error[E0716]: temporary value dropped while borrowed | |
// --> src/main.rs:21:14 | |
// | | |
// 21 | let upper = "abc".to_uppercase().as_str(); | |
// | ^^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement | |
// | | | |
// | creates a temporary which is freed while still in use | |
// 22 | println!("{}", upper); | |
// | ----- borrow later used here | |
// | |
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
[ | |
{ | |
"type": "template", | |
"name": "about", | |
"parameters": {}, | |
"positionalParameters": [ | |
["domestic cats"], | |
["the cat family"], | |
["Felidae"], | |
["the musical"], |
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
Cats, also called domestic cats (Felis catus), are small, carnivorous mammals, of the family Felidae. | |
Domestic cats are often called 'house cats' when kept as indoor pets. Cats have been domesticated (tamed) for nearly 10,000 years. | |
They are one of the most popular pets in the world. They are kept by humans for hunting rodents and as companions. | |
There are also farm cats, which are kept on farms to keep rodents away; and feral cats, which are domestic cats that live away from humans. | |
A cat is sometimes called a kitty. A young cat is called a kitten. A female cat that has not had its sex organs removed is called a queen. A male cat that has not had its sex organs removed is called a tom. |
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
#!/usr/bin/env python3 | |
import subprocess | |
UNITS = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'] | |
def human_readable_size_to_bytes(size_str): | |
size, unit = size_line.split() | |
return int(size) * (1 << (UNITS.index(unit) * 10)) | |
def chunks(lst, 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
// ==UserScript== | |
// @name Kill Sticky Headers (Ctrl/Cmd+Shift+K) | |
// @homepage http://alisdair.mcdiarmid.org/kill-sticky-headers/ | |
// @version 0.1 | |
// @description Kill sticky headers | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
function killSticky() { |
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
// ==UserScript== | |
// @name YouTube global shortcuts | |
// @namespace https://gist.github.com/stefansundin/ | |
// @homepage https://gist.github.com/stefansundin/65e3d6db697636d8e7f1 | |
// @downloadURL https://gist.github.com/stefansundin/65e3d6db697636d8e7f1/raw/youtube-global-shortcuts.user.js | |
// @version 1.1 | |
// @author Stefan Sundin | |
// @description Makes the YouTube shortcuts work even if the player is not focused. | |
// @icon https://www.youtube.com/favicon.ico | |
// @match https://www.youtube.com/* |
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
'use strict' | |
// babel countfiles_es7.js -o countfiles_es7.out.js --optional runtime --source-maps inline | |
require('source-map-support').install(); | |
import Promise from 'bluebird'; | |
import path from 'path'; | |
let fs = Promise.promisifyAll(require('fs')); |
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
// ==UserScript== | |
// @name DragScroll | |
// @include * | |
// @version 1 | |
// @grant none | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js | |
// ==/UserScript== | |
(function ($) { | |
var dragging = false; |
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_parent_dir() { | |
[[ $(dirs | cut -f 1 -d ' ') != $(readlink -f `pwd`/..) ]] && pushd -q .. | |
zle reset-prompt | |
# print -Pn "\e]0;%~\a" # Tab title | |
} | |
cd_back() { | |
[[ $(dirs -v | wc -l) -ne 1 ]] && popd -q | |
zle reset-prompt | |
# print -Pn "\e]0;%~\a" # Tab title |