Skip to content

Instantly share code, notes, and snippets.

// Drafts 4 script step to create custom tags
// using the a line or a default value if that line is empty or missing
// split draft into an array of lines
var lines = draft.content.split('\n');
// reusable function to define tag based on line or default string
function createLineTag(lineNumber,default) {
var tagName = "line"+(lineNumber+1).toString();
if(lines[lineNumber] && lines[lineNumber].length > 0) {
@drdrang
drdrang / Wifi Statusbar.py
Last active December 31, 2015 07:48
Overlay full strength graphics on statusbar of an iOS screenshot when the device is using wifi.
#!/usr/bin/python
import Image
import base64, zlib
# Jay Parlar convinced me to turn this data structure
# from a dictionary into an object.
class PackedImage(object):
def __init__(self, mode, size, data):
self.mode = mode
@aceakash
aceakash / .eslintrc
Created July 26, 2015 10:05
ESLint Configuration for Node.js/ES6
{
"rules": {
"indent": [2, 2],
"quotes": [2, "single"],
"linebreak-style": [2, "unix"],
"semi": [2, "always"],
"no-underscore-dangle": 0,
"curly": 0,
"no-use-before-define": [2, "nofunc"],
"spaced-comment": [2, "always"],
@drdrang
drdrang / Cleanbar.py
Last active July 6, 2017 20:28
Clean up the statusbar of an iOS screenshot. The time in the statusbar is maintained, but all other graphics are stripped out and replaced with graphics that show full battery and signal strength. The cellular provider is replaced with the Apple logo, . All graphics are built into the script, which works for any Retina iOS device in any orienta…
#!/usr/bin/python
import Image
import base64, zlib
# Jay Parlar convinced me to turn this data structure
# from a dictionary into an object.
class PackedImage(object):
def __init__(self, mode, size, data):
self.mode = mode
@BenjyWiener
BenjyWiener / ReplayKit.py
Last active September 7, 2017 04:34
ReplayKit.py
# coding: utf-8
from objc_util import *
from Foundation import NSBundle
NSBundle.bundleWithPath_('/System/Library/Frameworks/ReplayKit.framework').load()
RPScreenRecorder = ObjCClass('RPScreenRecorder')
@ramv
ramv / kirby.conf
Created March 6, 2014 23:49
Kirby NGINX configuration
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){
@harryjubb
harryjubb / Find and Replace.py
Created June 1, 2013 18:58
Find and Replace in Pythonista for iPad
'''
Pythonista Find and Replace
===========================
Notices
-------
Copyright 2013 Harry Jubb.
This program is free software: you can redistribute it and/or modify
@tkadlec
tkadlec / perf.js
Created April 23, 2015 11:54
Super simple example of adding perf timing to the page display during dev work
(function () {
var perfBar = function(budget) {
window.onload = function() {
window.performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
var timing = window.performance.timing,
now = new Date().getTime(),
output, loadTime;
@ffxsam
ffxsam / Suspense.ts
Last active November 27, 2023 23:30
Vue 3's Suspense component, ready for use in Vue 2.x (TypeScript)
import Vue from 'vue';
export const Suspense = Vue.extend({
name: 'Suspense',
data: () => ({
resolved: false,
}),
async created() {
const setupMethod = (this.$parent as any).setup;
if (!setupMethod) {
@dstroot
dstroot / app.js
Created July 13, 2014 16:29
Gulp, BrowserSync, Node, and Nodemon all working in harmony. ;)
/**
* World's simplest express server
* - used to serve index.html from /public
*/
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use(serveStatic(__dirname + '/public'));