much, much newer and better ?
To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion
delete keysfromscript; | |
delete wholeset; | |
try { | |
var keysfromscript = []; | |
} catch(e) { | |
keysfromscript = []; | |
} | |
try { |
// Unsure where this came from. | |
// If this code is yours, please let me know! | |
function display_size_data(){ | |
// Check for support of the PerformanceResourceTiming.*size properties and print their values | |
// if supported. | |
if (performance === undefined) { | |
console.warn("Display Size Data: performance NOT supported"); | |
return; | |
} |
// Unsure where this code came from. | |
// Please get in touch if it is yours! | |
function calculate_load_times() { | |
// Check performance support | |
if (performance === undefined) { | |
console.log("= Calculate Load Times: performance NOT supported"); | |
return; | |
} |
// see blog post: http://www.hiddentao.com/archives/2013/07/08/generate-overridable-getters-and-setters-in-javascript/ | |
Function.prototype.generateProperty = function(name, options) { | |
// internal member variable name | |
var privateName = '__' + name; | |
options = options || {}; | |
options.get = ('undefined' === typeof options.get ? true : options.get ); | |
options.set = ('undefined' === typeof options.set ? true : options.set ); | |
// pre-initialise the internal variable? |
much, much newer and better ?
To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.
import sublime | |
import sublime_plugin | |
class CursorCommand(sublime_plugin.TextCommand): | |
saved_cursors_map = {} | |
def run(self, edit, action="add"): | |
view = self.view | |
cursors = view.sel() | |
view_id = view.id() |
# File Transfer for Pythonista | |
# ============================ | |
# This script allows you to transfer Python files from | |
# and to Pythonista via local Wifi. | |
# It starts a basic HTTP server that you can access | |
# as a web page from your browser. | |
# When you upload a file that already exists, it is | |
# renamed automatically. | |
# From Pythonista's settings, you can add this script | |
# to the actions menu of the editor for quick access. |
# A simple Evernote API demo script that lists all notebooks in the user's | |
# account and creates a simple test note in the default notebook. | |
# | |
# Before running this sample, you must fill in your Evernote developer token! | |
# | |
# This sample is part of the Evernote SDK and has been modified slightly for | |
# Pythonista, to take advantage of the clipboard and PIL modules. | |
# If there is an image in the clipboard when the script is run, it is attached | |
# to the sample note. |
# Simple installer script for using the Evernote SDK in Pythonista | |
# | |
# This script should be run from the root directory. In order to keep things | |
# tidy, it installs the module and all its dependencies in a directory named | |
# 'evernote-sdk'. In order to be able to import it, you have to add that to | |
# your import path, like this: | |
# | |
# import sys | |
# sys.path.append('evernote-sdk') | |
# |
# coding: utf-8 | |
'''Creates a zip archive of your Pythonista files and serves them via HTTP in your local network.''' | |
import sys | |
if sys.version_info[0] >= 3: | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
else: | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from BaseHTTPServer import HTTPServer |