_________ _____ _______________ _____
\_ ___ \\ \\___________ \____ / ____\ ~/.bash/cliref.md
/ \ \/| | | || _/ __ \ __\ copy/paste from whatisdb
\ \___|__ |_|_ || | \ __/|_ | http://pastebin.com/yGmGiDQX
\________ /_____ \_||____|_ /____ /_| yunga.palatino@gmail.com
20140825 \/ \/ \/ \/
View fails-first.user.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
// ==UserScript== | |
// @name fails-first | |
// @namespace https://asottile.dev | |
// @version 0.1 | |
// @description put failed statuses first | |
// @author asottile | |
// @match https://github.com/*/*/pull/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
// @grant none | |
// ==/UserScript== |
View fsso.user.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
// ==UserScript== | |
// @name fsso | |
// @namespace https://asottile.dev | |
// @version 0.1 | |
// @description click a da button | |
// @author asottile | |
// @match https://github.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
// @grant none | |
// ==/UserScript== |
View ordered_iterator.rs
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 std::iter::{Iterator, Peekable}; | |
use std::collections::BinaryHeap; | |
use std::cmp::Ordering; | |
use std::cell::RefCell; | |
use std::iter::FromIterator; | |
struct WrappedIterator<T: Ord, P: Iterator<Item = T>>(RefCell<Peekable<P>>); | |
impl<T: Ord, P: Iterator<Item = T>> PartialEq for WrappedIterator<T, P> { | |
fn eq(&self, other: &Self) -> bool { |
View pagination_example.sql
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
-- Reasonably efficient pagination without OFFSET | |
-- SQLite version (Adapted from MS SQL syntax) | |
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6 | |
SELECT foo, bar, baz, quux FROM table | |
WHERE oid NOT IN ( SELECT oid FROM table | |
ORDER BY title ASC LIMIT 50 ) | |
ORDER BY title ASC LIMIT 10 |
View chomp_numbering_wrapper.rs
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 std::marker::PhantomData; | |
pub trait NumberingType { | |
type Token; | |
type Position; | |
fn update(&mut self, &[Self::Token]); | |
fn position(&self) -> Self::Position; | |
} |
View ImmutableCursorStore.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
var structure = immstruct({turtles: []}); | |
var TurtlesComponent = React.createClass({ | |
componentWillMount: function() { | |
this.setState({turtlesCursor: structure.cursor()} | |
structure.on('swap', () => | |
this.setState({turtlesCursor: structure.cursor()})); |
View cliref.md
View Mori Calendar.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
var mori = require("mori"); | |
function Calendar(appointments, previousCalendar) { | |
appointments = appointments; | |
var cal = {}; | |
cal.add = function(appointment) { | |
var withAppointments = mori.conj(appointments, appointment); | |
return Calendar(withAppointments, cal); |
View np.zsh
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
# npm publish with goodies | |
# `np` with an optional argument `patch`/`minor`/`major`/`<version>` | |
# defaults to `patch` | |
np() { | |
trash node_modules &>/dev/null; | |
git pull --rebase && \ | |
npm install && \ | |
npm test && \ | |
npm version ${1:=patch} && \ | |
npm publish && \ |
View optimize.sh
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/sh | |
# script for optimizing images in a directory (recursive) | |
# pngcrush & jpegtran settings from: | |
# http://developer.yahoo.com/performance/rules.html#opt_images | |
# pngcrush | |
for png in `find $1 -iname "*.png"`; do | |
echo "crushing $png ..." | |
pngcrush -rem alla -reduce -brute "$png" temp.png |
NewerOlder