A Pen by Captain Anonymous on CodePen.
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
// 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() |
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
$('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')); | |
}); |
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
-- 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 |
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
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 |
- Javascript fundamentals 7- hours
- Udacity Javascript Basics
- NodeSchool.io - Javascripting
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 me = 'Bruce Wayne' | |
function greetMe() { | |
console.log('Hello, ' + me + '!') | |
} | |
greetMe() // Hello, Bruce Wayne! |
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 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/')); | |
}); |
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
# -*- 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. |
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
function emoji() { | |
if (navigator.userAgent.indexOf('Mac OS X') != -1) { | |
window.location.hash = "💋"; | |
} | |
}; | |
emoji(); | |
// only works on Macs 😞 |