Skip to content

Instantly share code, notes, and snippets.

View andregoncalves's full-sized avatar
🏠
Working from home

Andre Goncalves andregoncalves

🏠
Working from home
View GitHub Profile
Hi Bob,
Just wanted to inform you that we have not yet received payment of
invoice ####-##.
I'm sure you must have mistakenly overlooked this. I've included
a copy of the invoice for your convenience.
If payment has already been sent, please disregard this email. Do
not hesitate to contact me if you have any questions.
Can you please answer the following questions so we can assess the project,
and judge if we would be a good match?
1. Is this a new project, or is this for an existing website or application?
- This is a project for a completely new site or application
- This is a project to update an existing site or application
2. Which of the following areas do you need help with?
#!/usr/bin/env bash
sudo rm -rf ~/chef
mkdir ~/chef
cd ~/chef
chef_binary=/usr/local/bin/chef-solo
# Are we on a vanilla system?
if ! test -f "$chef_binary"; then
export DEBIAN_FRONTEND=noninteractive
# Upgrade headlessly (this is only safe-ish on vanilla systems)
@andregoncalves
andregoncalves / form-submit-tracking-1.js
Created October 27, 2012 10:35
Analytics form submit tracking 2
$("form").on('submit', function(e) {
var form = this;
if (_gaq) {
e.preventDefault();
_gaq.push(['_trackEvent', 'my category', 'my action']);
setTimeout(function() { form.submit(); }, 100);
return false;
}
@andregoncalves
andregoncalves / form-submit-tracking-1.js
Created October 26, 2012 18:09
Analytics form submit tracking 1
$("form").on('submit', function(e) {
if (_gaq)
_gaq.push(['_trackEvent', 'my category', 'my action']);
return true;
});
@andregoncalves
andregoncalves / geophoto.js
Created January 21, 2012 18:42
GeoPhoto widget initializer code
geoPhoto.initialize({
container: 'map',
filter: '',
geolocation: true,
latitude: 37.7749295,
longitude: -122.4194155,
zoom: 8,
maxSearchResults: 100
});
/* Other initialization parameters
@andregoncalves
andregoncalves / gist:1090424
Created July 18, 2011 19:32
Check if Chrome Web Store App is installed
if (navigator && navigator.userAgent && navigator.userAgent.indexOf('Chrome') != -1) {
var isInstalled = window.chrome && window.chrome.app && window.chrome.app.isInstalled;
var isCancelled = document.cookie.indexOf(cookie + "=true") >= 0;
(...)
}
@andregoncalves
andregoncalves / gist:1090367
Created July 18, 2011 19:13
Chrome Install Notification Bar
(function() {
// Configuration Parameters
var message_html = "<App> is now available in the Chrome Web Store"
// Webstore install page URL
var app_install_url = "https://chrome.google.com/webstore/detail/lnempicjilmahngopecohbcbldlijkib";
// 24x24 App icon
var app_icon = "";
var cookie = "_webstore_preference";
// URL for stylesheet
var stylesheet_url = "chrome-notification.css";
@andregoncalves
andregoncalves / social_tracking.js
Created July 6, 2011 17:59
Google analytics social events tracking
trackSocialEvents: function() {
// Track Facebook
FB.Event.subscribe('edge.create', function(targetUrl) {
_gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
});
// Track Twitter
twttr.events.bind('tweet', function(event) {
if (event) {