Skip to content

Instantly share code, notes, and snippets.

View twhite96's full-sized avatar
☢️
Cookin

tiff twhite96

☢️
Cookin
View GitHub Profile
@threepointone
threepointone / gist:43f16389fd96561a8b0b
Last active February 13, 2023 02:12
sto alternate api
// store.js
let {store, handler} = sto(initialState, reduceFn); // where reduceFn: function(currentState, action, ...args){}
dispatcher.register(handler);
export store;
// elsewhere
store.get() // -> current state
store.toObservable() // -> to be used with .observe()
$('a.link').click(function(){
// `this` is an anchor DOM element in this context
// but it's not wrapped in a jQuery wrapper and doesn't
// have access to any of jQuery's helper methods.
var $a = $(this);
// once you wrap it in jQuery, it has access to them,
// for example to `.attr()`, `.prop()`, `.val()`, etc.
console.log('Clicked on', $a.attr('href'));
});
@derickfay
derickfay / TE recipient
Last active December 9, 2017 06:39
TextExpander snippet to add recipient's name to email
-- TextExpander snippet to add recipient's name to email
-- based on http://macsparky.com/blog/2015/6/automatically-add-recipients-name-to-email-with-textexapnder [sic]
-- updated to handle hyphenated first names properly
-- ( Original version would return Young for Young-Hee . This version returns Young-Hee. )
set theResult to ""
tell application "System Events"
tell process "Mail"
tell text field "To:" of window 1
@gruber
gruber / Paste URL From Safari Tab.scpt
Created June 29, 2015 00:01
Paste URL From Safari Tabs
set _old_delims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {""}
tell application "System Events"
set _current_app to name of the first process whose frontmost is true
end tell
tell application "Safari"
set _urls to {}
repeat with i from 1 to 6 -- how many Safari windows to show URLs from
@royshouvik
royshouvik / Full Stack JavaScript.md
Last active July 6, 2023 13:55
Learn Full Stack JavaScript Web Development for FREE using resources like YouTube, Udacity and NodeSchool
@mpj
mpj / example1.js
Last active January 14, 2019 16:03
Examples for video "Closures - Part 5 of Functional Programming in JavaScript" (http://youtu.be/CQqwU2Ixu-U)
var me = 'Bruce Wayne'
function greetMe() {
console.log('Hello, ' + me + '!')
}
greetMe() // Hello, Bruce Wayne!
@supalogix
supalogix / gulpfile.js
Created September 2, 2015 07:49
A gulp file for our demo project
var gulp = require('gulp');
var jasmine = require('gulp-jasmine');
var typescript = require('gulp-tsc');
var runSequence = require('run-sequence');
gulp.task('compile', function(){
return gulp.src(['src/ts/**/*.ts'])
.pipe(typescript())
.pipe(gulp.dest('src/js/'));
});
@vik-y
vik-y / delete_all_tweets.py
Last active September 22, 2023 21:04 — forked from davej/delete_all_tweets.py
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script is forked originally from Dave Jeffery. The original implementation
was very slow and deleted around 2 tweets per second. Making it multithreaded I
am able to delete 30-50 tweets per second.
@author: vik-y
----------------------------------------------------------------------------
This script will delete all of the tweets in the specified account.
@minamarkham
minamarkham / emoji.js
Created October 28, 2015 18:17
Add emojis to URL
function emoji() {
if (navigator.userAgent.indexOf('Mac OS X') != -1) {
window.location.hash = "💋";
}
};
emoji();
// only works on Macs 😞