Skip to content

Instantly share code, notes, and snippets.

View newtriks's full-sized avatar

Simon Bailey newtriks

View GitHub Profile
@newtriks
newtriks / flex.sublime-build
Created January 7, 2013 20:32
Sublime flex build file for mxmlc compilation
{
"cmd": [
"/Users/newtriks/Library/Developer/SDK/flex_sdk_4.6.0.23201B/bin/mxmlc",
"$file",
"-static-link-runtime-shared-libraries=false",
"-load-config+=${file_path}/../config.xml",
"-keep-as3-metadata+=Inject",
"-keep-as3-metadata+=PostConstruct",
"-allow-source-path-overlap=true",
"-locale=en_US",
@newtriks
newtriks / buildfile
Created January 7, 2013 21:25
An example Flex buildfile for Buildr-AS3
require "fileutils"
require "buildr/as3" # needs - gem install buildr-as3 -v "0.2.30.pre"
# Version number for this release will become dynamic
VERSION_NUMBER = "0.0.1"
# Group identifier for your projects
GROUP = "com.newtriks"
COPYRIGHT = "newtriks.com"
@newtriks
newtriks / buildr-as3.sublime-build
Created January 7, 2013 21:37
Sublime-build file for running Buildr-as3
{
"cmd": ["/usr/local/bin/rbenv", "exec", "buildr", "compile"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
@newtriks
newtriks / encodeaudio.sh
Created January 20, 2013 12:33
Join input audio files and encode to MP4 using ffmpeg
#!/bin/bash
# the version of the script
VERSION=1.0
echo "------------------------------------------"
echo "Audio Specific Concat Script v$VERSION - A script to concatenate multiple audio files and encode to MP4."
echo "Based on FFmpeg - www.ffmpeg.org and http://goo.gl/eDFeM"
echo "------------------------------------------"
@newtriks
newtriks / convert_pdf_to_jpg.rb
Created February 8, 2013 12:34
Convert PDF to JPG removing transparency and add white background using ImageSorcery (supports multi-page PDF's)
#https://github.com/EricR/image_sorcery
require 'image_sorcery'
image = ImageSorcery.new("example.pdf")
image.manipulate!(format: "jpg", :resize => '400x300', :quality => 100, :density => 150, :background => 'white', :alpha => 'Remove')
@newtriks
newtriks / generate_thumbnail.rb
Created April 3, 2013 15:53
Class to generate thumbnails for images in a dir stored in an Amazon S3 bucket.
#!/usr/bin/env ruby
###################################################
#
# Class to generate thumbnails for images in a dir
# stored in an Amazon S3 bucket.
#
# simon@newtriks.com - 10/2012
#
###################################################
@newtriks
newtriks / image_scraper.rb
Created April 3, 2013 16:25
Sinatra script to scrape a specific xml file for image urls and upload the linked images to an Amazon S3 bucket. Change to suit your particular XML nodes.
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'haml'
require 'nokogiri'
require 'aws/s3'
set :bucket, 'bucket-name'
set :s3_key, 'xxxxxx'
set :s3_secret, 'xxxxxx'
'use strict';
describe('Directive: albums', function() {
beforeEach(module('directiveExampleApp'));
var element, scope;
beforeEach(module('views/templates/albums.html'));
beforeEach(inject(function($rootScope, $compile) {
'use strict';
angular.module('directiveExampleApp')
.directive('albums', function() {
return {
templateUrl: 'views/templates/albums.html',
restrict: 'E',
scope: {}
};
});
'use strict';
angular.module('directiveExampleApp')
.directive('albums', function() {
return {
templateUrl: 'views/templates/albums.html',
restrict: 'E',
scope: {
title: '@title'
}