Skip to content

Instantly share code, notes, and snippets.

@cowboy
cowboy / HEY-YOU.md
Last active May 16, 2024 13:31
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@unscriptable
unscriptable / tiny Promise.js
Created February 7, 2011 06:02
A minimalist implementation of a javascript promise
// (c) copyright unscriptable.com / John Hann
// License MIT
// For more robust promises, see https://github.com/briancavalier/when.js.
function Promise () {
this._thens = [];
}
Promise.prototype = {
@0xadada
0xadada / README.md
Last active August 5, 2022 16:48
VIM movement, keyboard commands and shortcuts
@gabesumner
gabesumner / fiddle.css
Last active November 19, 2023 06:01
Address Validation using the Google Maps API
body {
font: 12px verdana;
background-color: #5C87B2;
}
form {
max-width: 400px;
padding: 15px;
background-color: white;
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 21, 2024 01:45
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@wavded
wavded / promise.js
Last active May 6, 2021 13:25
Promise A+ Implementation
"use strict"
var Promise = function () {
this.state = 'pending'
this.thenables = []
}
Promise.prototype.resolve = function (value) {
if (this.state != 'pending') return
this.state = 'fulfilled'
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 13, 2024 10:59
A badass list of frontend development resources I collected over time.
@hoppfrosch
hoppfrosch / WakeUp.ahk
Created January 6, 2014 12:26
AHK wake-up-timer #ahk #script #function
; AHK wake-up-timer
; scheduler provides some of the functions of Window's Task Scheduler or the command line tool "schtasks" as an AHK-script.
; Unlike Windows' Scheduled Tasks this function works with accounts without passwords
;
; Author: boskoop (http://http://www.autohotkey.com/board/topic/10587-wake-up-timer-scheduler-function)
; CONFIGURATION
Year=2006
Month=8 ;1-12
Day=30 ;1-31
@janosgyerik
janosgyerik / only-vim-can-do.md
Last active December 24, 2016 04:15
Things only Vim can do easily
  1. Works even under the most spartan conditions (in a simple remote shell window such as xterm, putty), with syntax highlighting, function folding, tabs, buffers, and all that lightning fast
  2. Delete lines matching pattern: g/pattern/d
  3. Delete lines not matching pattern: g!/pattern/d
  4. Sort buffer: :%sort
  5. Filter buffer through command :%!sort -u
  6. Delete from current line until end of file (try with a large file!)
  7. Increment numeric values: C-a, C-x
  8. Complete line pattern C-x C-l
  9. Convert a DOS file (with CRLF line endings) to UNIX: :set ff=unix (and then save it)
@chenglou
chenglou / gist:40b75d820123a9ed53d8
Last active March 13, 2024 12:14
Thoughts on Animation

Interesting part (unmounting & API) is at the end if you're not interested in the rest =).

Stress Tests

This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.

  1. Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.

  2. Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch