Skip to content

Instantly share code, notes, and snippets.

@adamyanalunas
adamyanalunas / dabblet.css
Created February 4, 2012 02:04
A sublte button
/**
* A sublte button
*/
.btn:hover .inner {
background-position: 0 15px;
-webkit-transition: background-position .1s linear;
}
@adamyanalunas
adamyanalunas / dabblet.css
Created July 23, 2012 16:05 — forked from gentle-media/dabblet.css
CSS3 ribbon buttons
/**
* CSS3 ribbon buttons
*/
.ribbonA{
position: relative;
display: block;
width: 258px;
height: 50px;
font: .9em/50px Georgia, "Times New Roman", Times, serif;
@adamyanalunas
adamyanalunas / clearField.js
Created September 15, 2012 00:05
Fix magic moving focus on franklabs.com/igs
function clearField(field)
{
if ( field && field.value )
field.value = '';
}
@adamyanalunas
adamyanalunas / jasmine.toBeTypeOf.js
Created October 21, 2012 01:14
jasmine.js matcher to test type of object
jasmine.Matchers.prototype.toBeTypeOf = function(expected) {
var actual, notText, objType;
actual = this.actual;
notText = this.isNot ? 'not ' : '';
objType = actual ? Object.prototype.toString.call(actual) : '';
this.message = function() {
return 'Expected ' + actual + notText + ' to be an array';
}
@adamyanalunas
adamyanalunas / sdbw.css
Created October 23, 2012 05:37
Updates to make SDBW entries more readable
.ui-addtocal {
cursor: pointer; /* No need for cursor: hand; Nobody uses IE 5.5 any more */
position: absolute;
bottom: 10px;
right: 17px;
}
ol#eventsList h6.eventHost {
width: 220px
}
@adamyanalunas
adamyanalunas / broker.js
Created November 9, 2012 20:43
Abstracting event names from broker calls
app.events = {
data: {
},
ui: {
main: {
channel: 'ui.main',
topics: {
layoutLoaded: 'layout.loaded'
@adamyanalunas
adamyanalunas / date_helper.coffee
Last active December 16, 2015 17:59
Sinon's time freezing is destroyed by Sugar.js
exports.DateHelper = {
lock: (msSinceEpoc) ->
# NOTE: Needed because Calendar model expects moment in the global scope.
global.moment = require('moment')
# NOTE: This can be removed once Sugar.js is removed
dateSugar = Date.SugarMethods
clock = sinon.useFakeTimers(msSinceEpoc)
# NOTE: This can be removed once Sugar.js is removed
Date[k] = v.method for k,v of dateSugar
@adamyanalunas
adamyanalunas / example.m
Created May 11, 2013 06:14
Stubbing PSPDFViewController
context(@"stubbing init/alloc", ^{
describe(@"can stub", ^{
__block PSPDFViewController *psVC;
__block PSPDFViewController *initVC;
beforeEach(^{
psVC = PSPDFViewController.alloc;
initVC = [psVC init];
[PSPDFViewController stub:@selector(alloc) andReturn:psVC];
@adamyanalunas
adamyanalunas / base.css
Created May 30, 2013 16:34
Fix the chat so the × icon and text don't compete for layout space (and other UI tweaks).
.activity-text {
padding-right: 22px;
}
.activity-item .activity-delete {
top: 9px;
}
.activity-item:hover .activity-delete {
opacity: .75;
@adamyanalunas
adamyanalunas / scrubadub_mixpanel.js
Last active December 18, 2015 01:59
Making real JSON from Mixpanel's dump API.
var takeDump = function(foo, bar, body) {
// The "body" is the raw response from https://data.mixpanel.com API
// At this point there are line returns (\n) separating each event and the list of events is not wrapped in an array literal ([])
// Take out line returns and replace with proper comma separators
var tight = body.replace(/[\n\r\t]/g, ',');
// To return a list you've got to wrap it in an array
// There's a trailing newline returned, hence the substring snip
var wrapped = '[' + tight.substring(0, tight.length-1) + ']';