Skip to content

Instantly share code, notes, and snippets.

View roykolak's full-sized avatar

Roy Kolak roykolak

  • Detective.io
  • Chicago, IL USA
View GitHub Profile
function hexToRgb(hex) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
}
@roykolak
roykolak / index.html
Created June 23, 2015 03:27
experiment-api.html
<ui-experiment>
<ui-variant id="control">
<h3>Control</h3>
</ui-variant>
<ui-variant id="variant1">
<h3>Variant 1</h3>
</ui-variant>
<ui-variant id="variant2">
<h3>Variant 2</h3>
</ui-variant>
### Keybase proof
I hereby claim:
* I am roykolak on github.
* I am roykolak (https://keybase.io/roykolak) on keybase.
* I have a public key whose fingerprint is 19D3 8BEA E463 A684 9F56 DF98 2EDA DA4F 4902 8B50
To claim this, I am signing this object:
&.offwhite-btn {
background-color: $offwhite;
color: #000;
&:hover {
background-color: #YOYOYO;
color: #HEYHEY;
}
}
&.offwhite-btn {
background-color: $offwhite;
color: #000;
}
class VisitsView extend Backbone.View
initialize: ->
@collection.on 'change', @renderVisits, @
renderVisits: ->
# ....
visits = new Backbone.Collection()
view = new VisitsView
var lookUpISBN = function(isbn, callback) {
var results = {...}
callback(results);
}
(function() {
var displaySearchResults = function(results, $container) {
$container.text(results);
};
@roykolak
roykolak / moment_i18n.js
Created August 2, 2012 15:07
Moment.js i18n in Better History
// Generated by CoffeeScript 1.3.1
(function() {
moment.lang('en', {
months: [
chrome.i18n.getMessage('january'),
chrome.i18n.getMessage('february'),
chrome.i18n.getMessage('march'),
chrome.i18n.getMessage('april'),
chrome.i18n.getMessage('may'),
system = require 'system'
##
# Wait until the test condition is true or a timeout occurs. Useful for waiting
# on a server response or for a ui change (fadeIn, etc.) to occur.
#
# @param testFx javascript condition that evaluates to a boolean,
# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
# as a callback function.
# @param onReady what to do when testFx condition is fulfilled,
diff --git a/public/coffeescripts/views/thumbs/thumbs.coffee b/public/coffeescripts/views/thumbs/thumbs.coffee
index f861575..2cffbea 100644
--- a/public/coffeescripts/views/thumbs/thumbs.coffee
+++ b/public/coffeescripts/views/thumbs/thumbs.coffee
@@ -55,6 +55,7 @@ class App.Views.Thumbs.Thumbs extends Backbone.View
hoverOn: (event) ->
return if @thumbClickInProgress
+ @_hideAllTooltips()
$(event.currentTarget).addClass('hover')