Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Lucas Arruda LucasArruda

🏠
Working from home
View GitHub Profile
@LucasArruda
LucasArruda / async_load.text
Last active Dec 20, 2015
Load a script asynchronously
View async_load.text
(function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.async = true; e.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); })();
@LucasArruda
LucasArruda / .bash_profile
Last active May 26, 2016
Quick 'n dirty nice .bash_profile for OS X
View .bash_profile
# USE IF YOU HAVE
#export JAVA15_HOME="/System/Library/Java/JavaVirtualMachines/1.5.0/Contents/Home/"
#export PATH=${JAVA15_HOME}/bin:$PATH
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH
#export MAVEN_OPTS="-Xmx1024m -Xms1024m -XX:MaxPermSize=1162m"
#export M2_HOME=/usr/local/apache-maven-2.2.1
#export M2=$M2_HOME/bin
#export PATH=$M2:$PATH
export M2_HOME=/Applications/apache-maven-3.2.3
View giffy
#!/usr/bin/env bash
if [[ ! -f "$1" ]]; then
echo "=> Movie file not found"
exit 1
fi
tempfile=/tmp/output.gif
rm -f $tempfile
@LucasArruda
LucasArruda / com.company.launchd.apache2.plist
Created Jun 3, 2013
OS X custom Apache launch daemon (/Library/LaunchDaemons/).
View com.company.launchd.apache2.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.company.launchd.apache2</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/apache2/bin/apachectl</string>
<string>start</string>
@LucasArruda
LucasArruda / What.java
Created Oct 31, 2012
Can someone guess what this code does?
View What.java
// ...
catMedia = (categoryId==157)?getCategoryMedia1():getCategoryMedia();
// ...
@LucasArruda
LucasArruda / install-updates.sh
Created Sep 27, 2012
Script to install system-wide updates
View install-updates.sh
#!/bin/sh
# Script to install system-wide updates
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get clean
@LucasArruda
LucasArruda / install-sublime.sh
Created Sep 27, 2012
Install Sublime Text 2
View install-sublime.sh
#!/bin/sh
# Script to install a downloaded 'Sublime Text 2' editor.
# Make sure you follow the editors license
if [ -z "$1" ]
then
echo "\n Function usage:"
echo " $ ./install-sublime.sh Sublime\ Text\ 2.0.1.tar.bz2"
echo "\n (replace tar.bz2 file with correct name)"
@LucasArruda
LucasArruda / install-rails.sh
Created Sep 27, 2012
Install Rails - Ubuntu 12.04
View install-rails.sh
#!/bin/sh
# Install Ruby 1.9.3 on rbenv and get Rails
cd
mkdir -p .rbenv/plugins
cd .rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
cd
@LucasArruda
LucasArruda / install-ruby.sh
Created Sep 27, 2012
Install Ruby - Ubuntu 12.04
View install-ruby.sh
#!/bin/sh
# Install Ruby on Ubuntu 12.04 with rbenv to manage
sudo apt-get install build-essential ruby-dev zlib1g-dev openssl libopenssl-ruby1.9.1 libssl-dev libruby1.9.1 libreadline-dev git-core libsqlite3-dev libxslt-dev libxml2-dev libpq-dev
rm -rf .rbenv
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
You can’t perform that action at this time.