- First item
- Second item
- Third item
- First item
- Second item
@mixin background-image2x($image, $extension: 'png') { | |
$imageOrig: "#{$image}.#{$extension}"; | |
$image2x: "#{$image}@2x.#{$extension}"; | |
$width: image-width($imageOrig); | |
$height: image-height($imageOrig); | |
background-image: image-url($imageOrig); |
// Handlebar helper | |
Handlebars.registerHelper('or', function () { | |
var args = arguments; | |
for (var i in args) { | |
if (args[i]) { | |
return args[i]; | |
} | |
} | |
return null; |
if( !window.location.hash && window.addEventListener && document.documentElement.clientWidth <= 500 ){ | |
window.addEventListener( "load",function() { | |
setTimeout(function(){ | |
window.scrollTo(0, 1); | |
}, 0); | |
}); | |
} |
// Ajax Get. Cached. And aborts current request | |
var get = (function($) { | |
var xhr; | |
var xhrURL; | |
var cache = {}; | |
return function(url, callback, jsonp) { | |
url += ((url.indexOf('?') === -1) ? '?' : '&'); | |
url += jsonp ? 'callback=?' : 'ajax=1'; | |
if (url == xhrURL && xhr.readystate != 4) { | |
// Already loading stuff, wait for it to finish |
<?php | |
/** | |
* Check if content is JSON | |
* | |
* @param string $content | |
* @return boolean | |
*/ | |
function w3_is_json($content) { | |
return json_decode($content) !== NULL; | |
} |
// | |
// NSString+Distance.h | |
// | |
// Created by Alexander Johansson on 2011-11-27. | |
// Based on http://stackoverflow.com/q/5684973/590396 | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSString (Distance) |
<?php | |
// Include parent | |
require_once 'Mage/Adminhtml/controllers/CustomerController.php'; | |
class MyNamespace_CustomerLogin_CustomerController extends Mage_Adminhtml_CustomerController { | |
function loginAction() { | |
$customerID = (int) $this->getRequest()->getParam('id'); |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId, | |
UserSchema = require('./User').UserSchema; | |
var FriendRequest = new Schema({ | |
from : {type: ObjectId, index:true}, // Why does not UserSchema.ObjectId work here, instead of ObjectId? | |
to : {type: ObjectId, index:true}, | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId, | |
hashlib = require('hashlib'); | |
var SAFE_COLS_TO_RETURN = function() { | |
return { | |
_id:1, |