Skip to content

Instantly share code, notes, and snippets.

View Version20130802151400.php
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
/**
* Add comments and collection_method to metricdata
*/
View amazon.rb
Puppet::Type.type(:a2mod).provide(:amazon) do
desc "Manage Apache 2 modules on Amazon OS"
confine :operatingsystem => :amazon
defaultfor :operatingsystem => :amazon
require 'pathname'
# modpath: Path to default apache modules directory /etc/httpd/mod.d
# modfile: Path to module load configuration file; Default: resides under modpath directory
View zapImageCache.js
zapImageCache = function() {
var appDataDir, cacheDir, dir, externalRoot;
if (Ti.Filesystem.isExternalStoragePresent()) {
appDataDir = Ti.Filesystem.getFile('appdata://').nativePath;
externalRoot = appDataDir.substring(0, appDataDir.lastIndexOf('/'));
cacheDir = "" + externalRoot + "/Android/data/" + Ti.App.id + "/cache/_tmp/remote-cache";
dir = Ti.Filesystem.getFile(cacheDir);
} else {
dir = Ti.Filesystem.getFile(Ti.Filesystem.applicationCacheDirectory, '_tmp', 'remote-cache');
}
@shanestillwell
shanestillwell / packages.js
Created Mar 22, 2013
Query your node_modules to build a list for packages.json
View packages.js
var fs = require("fs");
function main() {
fs.readdir("./node_modules", function (err, dirs) {
if (err) {
console.log(err);
return;
}
dirs.forEach(function(dir){
if (dir.indexOf(".") !== 0) {
@shanestillwell
shanestillwell / assets.js
Created Feb 25, 2013
Files used with node version assets
View assets.js
[ 'public/css/angular-ui.min.css',
'public/css/app.css',
'public/css/bootstrap.min.css',
'public/css/plugins.css',
'public/css/style.css',
'public/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png',
'public/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png',
'public/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png',
'public/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png',
'public/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png',
@shanestillwell
shanestillwell / find-version-assets.js
Created Feb 22, 2013
Find assets and version them.
View find-version-assets.js
'use strict';
var mime = require('mime');
var subDir = '/public';
var files = [];
var assets = [];
var grepFiles = [];
// Mime types that we consider assets
@shanestillwell
shanestillwell / gist:4963712
Created Feb 15, 2013
Get the short SHA for a file
View gist:4963712
git log --pretty=format:'%h' -n 1 tiapp.xml
View AppWindow.js
function ApplicationWindow(title) {
var self = Ti.UI.createWindow({
title:title,
backgroundColor:'white'
});
var button = Ti.UI.createButton({
height:44,
width:200,
title:L('openWindow'),
@shanestillwell
shanestillwell / app.js
Created Jan 31, 2013
Appcelerator code for click and drag an object. This particular one is constrained to just moving up and down.
View app.js
var self = Titanium.UI.createWindow({
title:'Window',
left:0,
top:0,
backgroundColor:'#FFF',
name:'win1'
});
var container = Ti.UI.createView({
height: 300,
@shanestillwell
shanestillwell / install.sh
Last active Dec 11, 2015
Install items needed to run node.js tests on Jenkins
View install.sh
#!/bin/bash
NPM=/usr/local/bin/npm
git clone https://github.com/isaacs/nave.git
./nave/nave.sh usemain v0.8.9
$NPM install -g mocha
$NPM install -g chai
$NPM install -g xunit-file
$NPM install -g jshint
You can’t perform that action at this time.