Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Busy transpiling into

Alberto Leal dashed

👨‍💻
Busy transpiling into
View GitHub Profile
@dashed
dashed / nyan.gif
Last active Apr 28, 2019
🏳️‍🌈🐱 nyan cat
@dashed
dashed / ordered_iterator.rs
Last active Mar 30, 2017 — forked from dat2/ordered_iterator.rs
Rust implementation of sorted iterator based on 2 input iterators
View ordered_iterator.rs
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 keybase.md

Keybase proof

I hereby claim:

  • I am dashed on github.
  • I am dashed (https://keybase.io/dashed) on keybase.
  • I have a public key whose fingerprint is 1934 42B1 BEC9 1884 50E6 CE66 DA2A 4E73 D491 CD26

To claim this, I am signing this object:

@dashed
dashed / pagination_example.sql
Created Jun 29, 2016 — forked from ssokolow/pagination_example.sql
Reasonably efficient pagination without OFFSET (SQLite version)
View pagination_example.sql
-- 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
@dashed
dashed / chomp_numbering_wrapper.rs
Last active Apr 25, 2016 — forked from m4rw3r/chomp_numbering_wrapper.rs
Just a quick implementation of line-numbering where a parser is wrapped to keep track of the number of lines it has parsed so far
View chomp_numbering_wrapper.rs
use std::marker::PhantomData;
pub trait NumberingType {
type Token;
type Position;
fn update(&mut self, &[Self::Token]);
fn position(&self) -> Self::Position;
}
View wrapcursor.js
const Immutable = require('immutable');
const Cursor = require('immutable/contrib/cursor');
const immstruct = require('immstruct');
const Iterable = Immutable.Iterable;
/**
(work in progress)
Wrapped immutable.js cursors:
@dashed
dashed / events.js
Created Feb 2, 2015
immstructor - wrapper around immstruct [WIP - very experimental]
View events.js
/**
* Events utility mixin for immstructor
*/
var
Promise = require('bluebird');
var
// TODO: Expose this?
/**
View jshint-reporter.js
// custom jshint-loader reporter
// Based on https://github.com/sindresorhus/jshint-stylish
var
beeper = require('beeper'),
chalk = require('chalk'),
table = require('text-table'),
stringLength = require('string-length'),
logSymbols = require('log-symbols');
function pluralize(str, count) {
View ImmutableCursorStore.js
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
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     yunga.palatino@gmail.com
 20140825 \/      \/         \/     \/