Skip to content

Instantly share code, notes, and snippets.

@sapphiriq
sapphiriq / README.md
Last active June 5, 2016 00:22
Recover iOS 9 Restriction Password

Steps

  • Create non-encrypted backup in iTunes
  • Download and open iBackupBot
  • Locate and open file at HomeDomain/Library/Preferences/com.apple.restrictionspassword.plist
  • screen
  • Open https://repl.it/CY2I
  • Change PASS_KEY and PASS_SALT to values from com.apple.restrictionspassword.plist
  • Click run
@sapphiriq
sapphiriq / index.js
Created February 22, 2016 20:46
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var window = require('global/window');
var hg = window.hg = require('mercury');
var h = window.h = require('mercury').h;
var state = window.state = hg.state({
counter: hg.value(0),
channelz: {
clicks: incrementCounter
@sapphiriq
sapphiriq / README.md
Last active August 29, 2015 14:07
SublimeText Javascript/Coffeescript snippets for require

Autonaming variables

// req<TAB>
var webpackDevServer = require('webpack-dev-server');
var merge = require('react/lib/merge');
var Store = require('../stores/Store');
$ git clone https://gist.github.com/60a89f7197719888630d.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/JSRequireSnippets
#!/bin/sh
PROXY_INTERFACE="Wi-Fi"
PROXY_HOST=localhost
PROXY_PORT=8558
if [[ $1 == "on" ]]; then
sudo networksetup -setwebproxy "$PROXY_INTERFACE" $PROXY_HOST $PROXY_PORT
echo "HTTP proxy enabled"
@sapphiriq
sapphiriq / README.md
Created May 30, 2013 20:04
LESS Responsive grid

LESS Responsive grid

grid.less

  • .columns(span) => .span-1, …, .span-12
  • .columns(col, 24) => .col-1, …, .col-24

TODO:

  • better "mobile first" offsets
@sapphiriq
sapphiriq / Gruntfile.coffee
Created December 18, 2012 09:07
Project template for grunt for compile Jade, Less, Coffee as static files.
#global module:false
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
meta:
version: '0.1.0',
banner: '/*!\n * Sapphiriq - v<%= meta.version %> - ' +
// ==UserScript==
// @name TracksFlow Download
// @namespace https://github.com/sapphiriq/
// @description Tracksflow content downloader
// @author Alexander Khorin <sapphiriq@gmail.com>
// @copyright Alexander Khorin, 2012-2013
// @include http://tracksflow.com/*
// ==/UserScript==
(function () {
@sapphiriq
sapphiriq / gist:3871020
Created October 11, 2012 08:37 — forked from paulirish/gist:839879
requestAnimFrame() shim.
// see http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
@sapphiriq
sapphiriq / less2stylus.coffee
Created September 26, 2012 08:00 — forked from NHQ/less2stylus.coffee
Convert LESS to Stylus for Twitter Bootstrap
# Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus
less2stylus = (string) ->
string = string
.replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets
.replace(/^(\ *)([^\ ]+)\ +\{\ *\n?\ *?/mg, "$1$2\n$1 ") # remove opening brackets
.replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through)
.replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets
.replace(/\;\ *?$/gm, "") # remove semicolons
.replace(/@([\w]+)[\s\t]*:(\ *)\ /g, "$$$1$2 = ") # replace @variable: with $variable =
.replace(/\@(?!import|media|font\-face|keyframes|extend)/g, "\$")
@sapphiriq
sapphiriq / gist:3757925
Created September 20, 2012 19:44 — forked from chrismatthieu/gist:964754
SIP Registrar with Tropo PSTN
// Run Redis - cd redis-2.2.4 and run src/redis-server
var sip = require('sip');
var sys = require('sys');
var redis = require('redis');
var tropoapi = require('tropo-webapi');
//Trim leading and trailing whitespace from string values.
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');