Skip to content

Instantly share code, notes, and snippets.

View mockee's full-sized avatar

Yan Shi mockee

View GitHub Profile
@mockee
mockee / building_neovim_on_debian.md
Last active February 21, 2023 10:52
Building Neovim on Debian

Install build prerequisites

$ sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl doxygen
$ git clone https://github.com/neovim/neovim
$ cd neovim && make CMAKE_BUILD_TYPE=RelWithDebInfo

Some of the dependencies may fail to download and you will need to download them manually to the .deps/build/download directory and grant permissions, then repeat make CMAKE_BUILD_TYPE=RelWithDebInfo

@mockee
mockee / 0_reuse_code.js
Last active September 8, 2015 08:32
Here are some things you can do with Gists in GistBox.
// 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 October 4, 2014 07:23
Qiniu storage for Ghost 0.5.2
// # 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 November 19, 2020 07:01
Facebook Puzzle — Canlendar
<!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;
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 April 23, 2013 07:26
Remove CLI tools
#!/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 December 15, 2015 12:29
Four directions of the HTML5 progress bar in Reader.
@import "arkui/mixins"
$bgColor = #d8d6ce
$pollyfill = #855b5b
#reading-progress
z-index: 1000
position: fixed
display: none
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 }
/*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 December 7, 2012 09:52
Replace `click` with `tap`
/*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]