Skip to content

Instantly share code, notes, and snippets.

@mockee
mockee / 0_reuse_code.js
Last active Sep 8, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mockee
mockee / ghost_0.5.2_qiniu.js
Created Oct 4, 2014
Qiniu storage for Ghost 0.5.2
View ghost_0.5.2_qiniu.js
// # Local File System Image Storage module
// The (default) module for storing images, using the local file system
var express = require('express'),
fs = require('fs-extra'),
path = require('path'),
util = require('util'),
Promise = require('bluebird'),
errors = require('../errors'),
config = require('../config'),
@mockee
mockee / facebook_puzzle_calendar.html
Last active Nov 19, 2020
Facebook Puzzle — Canlendar
View facebook_puzzle_calendar.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Puzzle — Lay Out Day</title>
<style>
html,body,div,h3,p { margin: 0; padding: 0; }
body {
font: 12px 'lucida grande', tahoma, verdana, arial, sans-serif;
View VB_restart_in_mavericks.app
on run {input, parameters}
do shell script "sudo /Library/StartupItems/VirtualBox/VirtualBox restart" password "password" with administrator privileges
return input
end run
@mockee
mockee / gist:5441499
Created Apr 23, 2013
Remove CLI tools
View gist:5441499
#!/bin/sh
RECEIPT_FILE1=/var/db/receipts/com.apple.pkg.DevSDK.bom
RECEIPT_PLIST1=/var/db/receipts/com.apple.pkg.DevSDK.plist
RECEIPT_FILE2=/var/db/receipts/com.apple.pkg.clang.bom
RECEIPT_PLIST2=/var/db/receipts/com.apple.pkg.clang.plist
RECEIPT_FILE3=/var/db/receipts/com.apple.pkg.llvm-gcc4.2.bom
RECEIPT_PLIST3=/var/db/receipts/com.apple.pkg.llvm-gcc4.2.plist
RECEIPT_FILE4=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.bom
RECEIPT_PLIST4=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.plist
@mockee
mockee / progressbar.sass
Last active Dec 15, 2015
Four directions of the HTML5 progress bar in Reader.
View progressbar.sass
@import "arkui/mixins"
$bgColor = #d8d6ce
$pollyfill = #855b5b
#reading-progress
z-index: 1000
position: fixed
display: none
View hide_addressbar.js
define(function() {
var bodyTag
, win = window
, doc = document
, docElement = doc.documentElement
function hideAddressBar(isPad) {
if (screen.width > 980 || screen.height > 980) { return }
if (win.navigator.standalone === true) { return }
View gist:4248194
/*jshint eqnull:true*/
define('jquery', ['jquery-src'], function() {
if (!('ontouchstart' in window)) { return jQuery }
require('mod/touch', function(){})
function returnFalse() {
return false
}
jQuery.fn.extend({
@mockee
mockee / gist:4232210
Created Dec 7, 2012
Replace `click` with `tap`
View gist:4232210
/*global _:true, Backbone:true*/
define('backbone', ['backbone-src'], function() {
if (!('ontouchstart' in window)) { return Backbone }
require('mod/touch', function(){})
var delegateEventSplitter = /^(\S+)\s*(.*)$/
function getValue(object, prop) {
if (!(object && object[prop])) { return null }
return _.isFunction(object[prop]) ? object[prop]() : object[prop]
@mockee
mockee / random_avatars.js
Created Nov 2, 2012
Showing avatars in random positions.
View random_avatars.js
;(function() {
var doc = document
, frag = doc.createDocumentFragment()
, ids = [
{ id: 'tifafa', name: 'tifa' }
, { id: 'godlikejay', name: 'Jay' }
, { id: 'mockee', name: 'mockee' }
].sort(function() {
return Math.random() > 0.5
})