Skip to content

Instantly share code, notes, and snippets.

View jasonsturges's full-sized avatar

Jason Sturges jasonsturges

View GitHub Profile
@jasonsturges
jasonsturges / Library.js
Last active January 4, 2016 07:08
JavaScript Backbone inheritance super method, Adobe DPS
ADOBE.LibraryView = ADOBE.AppView.extend({
initialize: function (isAPIAvailable, isOnline) {
ADOBE.LibraryView.__super__.initialize.apply(this, arguments);
}
});
@jasonsturges
jasonsturges / unicorn-voting-2014.user.js
Last active August 29, 2015 13:58
Stack Exchange Unicorn Voting 2014 User Script
// ==UserScript==
// @name Unicorn Voting 2014
// @description Unicorn voting animations for everyone! FOREVER! (2014 edition)
// @version 1.0
// @include http://stackoverflow.com/*
// @include http://meta.stackoverflow.com/*
// @include http://superuser.com/*
// @include http://serverfault.com/*
// @include http://stackapps.com/*
// @include http://*.stackexchange.com/*
@jasonsturges
jasonsturges / .gitignore
Last active October 30, 2020 16:13
Global .gitignore
# JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
## Directory-based project format
.idea/
## File-based project format
*.ipr
*.iws
*.iml
# Visual Studio Code
.vscode/
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@MenuItem ("Terrain/Object to Terrain")
static function Object2Terrain () {
// See if a valid object is selected
var obj = Selection.activeObject as GameObject;
if (obj == null) {
EditorUtility.DisplayDialog("No object selected", "Please select an object.", "Cancel");
return;
}
if (obj.GetComponent(MeshFilter) == null) {
@jasonsturges
jasonsturges / readme.md
Created September 10, 2014 17:39
Toggle hidden files Automator script for Mac OS X

To start, open up Automator (in the Applications folder) and choose a Service template. From the library choose "Run Shell Script" and drag it across to the workflow area. In the text box paste the following command:

STATUS=`defaults read com.apple.finder AppleShowAllFiles`
if [ $STATUS == YES ]; 
then
    defaults write com.apple.finder AppleShowAllFiles NO
else
    defaults write com.apple.finder AppleShowAllFiles YES
fi

killall Finder

@jasonsturges
jasonsturges / readme.md
Created November 5, 2014 22:10
Referencing RequireJS config instance

RequireJS config may be referenced via:

var config = requirejs.s.contexts._.config;

Given a require such as:

require.config({
    property: "value"
});
@jasonsturges
jasonsturges / photo-resize.jsx
Created June 16, 2016 19:22
Scale images to multiple sizes in Photoshop using JSX scripted batch processing automation
#target "photoshop"
if (BridgeTalk.appName == "photoshop") {
app.bringToFront();
var inputFolder = Folder.selectDialog("Select the folder containing photos to be resized."),
imageSizes = [2048, 1024, 512, 256];
if (inputFolder != null) {
var fileList = inputFolder.getFiles(/\.(jpg|jpeg|tif|psd|)$/i);
@jasonsturges
jasonsturges / index.html
Last active January 6, 2017 19:12
Flexbox masonry grid, similar to 500px image layout, from example: https://github.com/xieranmaya/blog/issues/6
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1080">
<title>Cats</title>
<style>
body {
margin: 0;
overflow-x: hidden;
}
@jasonsturges
jasonsturges / build-hxcpp.sh
Created March 29, 2017 22:02
Build and install Haxe Foundation hxcpp haxelib for macOS from latest GitHub commit
#!/bin/bash
#### Description: Build and install Haxe Foundation hxcpp haxelib for macOS
#### from latest GitHub: https://github.com/HaxeFoundation/hxcpp
#### Written by: Jason Sturges - jason@jasonsturges.com on 2017-03-29
haxelib remove hxcpp
haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git
cd /usr/local/lib/haxe/lib/hxcpp/git/tools/hxcpp