Skip to content

Instantly share code, notes, and snippets.

🐉
!

kumavis kumavis

🐉
!
Block or report user

Report or block kumavis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2722566
var currentState = get(this, 'currentState') || this, state, newState;
View gist:4948438
Helpers.Velcro =
getSelection: ($elem) ->
$elem.find('.selectedOption').text().trim()
hasSelection: ($elem) ->
not Helpers.Velcro.getSelection($elem).contains("Select")
selectRandomOption: ($elem, continueTesting) ->
$elem.find('.velcro-dropdown').click()
@kumavis
kumavis / gist:5138519
Last active Dec 14, 2015
Time in javascript
View gist:5138519

“Why, sometimes I've believed as many as six impossible things before breakfast.”

-- Lewis Carroll, Alice in Wonderland

new Date() === new Date()
//=> false
new Date() == new Date()
//=> false
new Date() > new Date()
View debounce.coffee
callMethod = (target, method, args) ->
method = target[method] if Ember.typeOf(method) is "string"
method.apply target, args
###
Returns a function, that, when invoked, will only be triggered at most once during a given window of time.
###
Ember.throttle = (target, method, wait) ->
timeout = undefined
@kumavis
kumavis / ember-stalkable.coffee
Last active Dec 15, 2015 — forked from Fordi/examples.js
ember-stalkable examples
View ember-stalkable.coffee
###
"Stalkable" objects can be watched for any and all changes
@author Bryan Elliott <belliott@rsicms.com>
###
###
Detect whether an Object is using this Mixin
###
Ember.Mixin::detectInstance = (object) ->
@kumavis
kumavis / gist:5600958
Last active Dec 17, 2015
More strange javascript behaviour
View gist:5600958

comparators

null < 1
//=> true
null < 0
//=> false
undefined < 1
//=> false
undefined < 0
//=> false
@kumavis
kumavis / gist:5603550
Created May 18, 2013
「ご存知の通り」の別の言い方
View gist:5603550
御承知置きの通り
お聞き入れの通り
お聞き届けの通り
御領承の通り
御応諾の通り
御承引の通り
@kumavis
kumavis / error_forwarding.coffee
Last active Dec 17, 2015
Ember error phone home
View error_forwarding.coffee
# ===
# = This helper sends client errors home to the server for logging
# ===
# TODO: include some client diagnostics, browser type etc
# Grab standard error callback
_super = Ember.Logger.error
# Overwrite error callback to phone home
Ember.Logger.error = (message) ->
@kumavis
kumavis / gist:5676173
Created May 30, 2013
npm ERR! peerinvalid The package voxel-engine does not satisfy its siblings' peerDependencies requirements!
View gist:5676173

fresh clone of voxel-gist [https://github.com/maxogden/voxel-gist]

[kumavis:...Development/Node/voxel-gist]$ npm install

npm http GET https://registry.npmjs.org/ecstatic/0.3.2
npm http GET https://registry.npmjs.org/jsonp/0.0.3
npm http GET https://registry.npmjs.org/javascript-editor/0.0.1
npm http GET https://registry.npmjs.org/snuggie/0.0.4
npm http GET https://registry.npmjs.org/uglify-js/2.2.3
@kumavis
kumavis / gist:5681595
Last active Dec 17, 2015
Quick and dirty grab of the node fs attributes used by node-browserify and dependencies. Generated by cloning the repo, npm install, project-wide search for "fs.", grabbing all the words following the period, forming them into a list of strings and dropping them into an irb sesh, calling uniq, sorting, then joining with a newline. Finally, manua…
View gist:5681595

filesystem-browserify implements: 7 attributes

createReadStream
createWriteStream
readFile
readdir
rename
unlink
writeFile
You can’t perform that action at this time.