Skip to content

Instantly share code, notes, and snippets.

View andreacfm's full-sized avatar

Andrea Campolonghi andreacfm

View GitHub Profile
@pcreux
pcreux / Gemfile
Last active December 11, 2023 20:24
Fast Rails + Heroku Configuration
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
@addyosmani
addyosmani / headless.md
Last active May 7, 2024 12:36
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@aiwilliams
aiwilliams / README.md
Created May 16, 2012 13:52
Storyboard in RubyMotion 1.4

Start XCode and create a new Storyboard file. I closed all my other XCode projects. When you choose the location of the created file, it should be your RubyMotion project's resources directory. Add a UIViewController, and set it's identifier property to "Start". Add some UI elements so you can see it working.

When you run rake in your RubyMotion project, it will compile the .storyboard file. You could auto-load the Storyboard using a plist configuration, but you'll see code can do it too.

@nhoffmann
nhoffmann / deploy.rb
Created April 3, 2012 14:07
Capistrano recipe for deploying static content.
set :application, "My Static Content"
set :servername, 'test.example.com'
# no git? simply deploy a directory
set :scm, :none
set :repository, "." # the directory to deploy
# using git? deploy from local git repository
# set :scm, :git
# set :repository, 'file//.' # path to local git repository
@c0diq
c0diq / Xcode4HockeyAppTestFlightintegration.sh
Created March 27, 2012 07:13
Automatic TestFlight/HockeyApp Upload XCode Script
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Inspired by original script by incanus:
# https://gist.github.com/1186990
#
# Rewritten by martijnthe:
# https://gist.github.com/1379127
#
@c0diq
c0diq / gist:2213492
Created March 27, 2012 07:02
Automatic CFBundleVersion increment Build Pre-Action Scheme
#!/bin/bash
if [[ $CONFIGURATION == *Adhoc* ]]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${PROJECT_DIR}/${INFOPLIST_FILE})
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" ${PROJECT_DIR}/${INFOPLIST_FILE}
fi
@lucasallan
lucasallan / install_postgis_osx.sh
Created September 6, 2011 21:03 — forked from klebervirgilio/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@andreacfm
andreacfm / ant.restart-railo
Created September 30, 2010 19:46
Ant target to restart a railo server
<target name="restartRailo" description="Restarts the Railo server.">
<get
src="http://${server.name}:${server.port}/server/railo_restart.cfm?admin_password=${admin.password}"
dest="${www}/server/temp/restart_output.txt"/>
<loadfile property="restart.status" srcFile="${www}/server/temp/restart_output.txt"/>
<echo message="Restart status: ${restart.status}"/>
@rip747
rip747 / CF8 Application.cfc
Created February 18, 2010 18:00
skeleton application.cfc file for cf8
<cfcomponent output="false">
<!--- Application name, should be unique --->
<cfset this.name = Hash(GetDirectoryFromPath(GetBaseTemplatePath()))>
<!--- How long application vars persist --->
<cfset this.applicationTimeout = createTimeSpan(0,2,0,0)>
<!--- define custom coldfusion mappings. Keys are mapping names, values are full paths --->
<cfset this.mappings = structNew()>
<!--- define a list of custom tag paths. --->
<cfset this.customtagpaths = "">