Skip to content

Instantly share code, notes, and snippets.

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

Uilian Souza uilian

🏠
Working from home
View GitHub Profile
@uilian
uilian / convertToMp3.sh
Created March 2, 2015 17:18
FFMPEG - Convert files to MP3
#!/bin/sh
for file in "$@" ; do
name=`echo "$file" | sed -e "s/.m4a$//g"`
ffmpeg -i "$file" -ab 280k -acodec libmp3lame "$name.mp3"
done
@uilian
uilian / grab_video.sh
Created March 2, 2015 17:30
FFMPEG - Video capture
-- Record a screencast and convert it to an mpeg, grab X11 input and create an MPEG at 25 fps with the resolution X×Y
ffmpeg -f x11grab -r 25 -s 640x480 -i :0.0 /tmp/DDoutputFile.mpg
@uilian
uilian / git-bash.sh
Created March 27, 2015 13:05
Git prompt console
function git-branch-name {
git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
}
function git-branch-prompt {
local branch=`git-branch-name`
if [ $branch ]; then printf " [%s]" $branch; fi
}
PS1="\u@\h \[\033[0;36m\]\W\[\033[0m\]\[\033[0;32m\]\$(git-branch-prompt)\[\033[0m\]\$ "
@uilian
uilian / create_user.sql
Created April 14, 2015 19:44
Creating basic user on Oracle
CREATE USER USERNAME;
GRANT CREATE SESSION TO USERNAME;
GRANT CREATE TABLE TO USERNAME;
GRANT CREATE SEQUENCE TO USERNAME;
GRANT UNLIMITED TABLESPACE TO USERNAME;
@uilian
uilian / grails-standalone.sh
Created April 20, 2015 12:25
Packaging Grails app using different java version
# http://grails-plugins.github.io/grails-standalone/docs/manual/index.html
grails -Dbuild.compiler=javac1.7 dev build-standalone application.jar
@uilian
uilian / sample-wsdl-to-java.txt
Created August 14, 2015 12:27
Grails WSDL To Java - with bindings
wsdl-to-java "--verbose" "--wsdl=http://192.168.0.1:8080/Service?WSDL" "--b=bindings.xml" "--p=br.com.uilian"
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings jaxb:version="2.1" jaxb:extensionBindingPrefixes="xjc"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns="http://java.sun.com/xml/ns/jaxws">
<jaxb:globalBindings generateElementProperty="false" generateIsSetMethod="true" >
@uilian
uilian / get-java.sh
Created August 14, 2015 12:29
Downloading Java from commandline
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u51-b16/jdk-8u51-linux-x64.tar.gz"
@uilian
uilian / gitworktree.sh
Created February 11, 2016 13:48
Git Worktree
## creating a new branch
git worktree add -b emergency-fix ../temp master
## or using an existing one
git worktree add ../temp master
pushd ../temp
# do your job
git commit -a -m 'emergency fix for boss'
popd
rm -rf ../temp
@uilian
uilian / Interview.js
Created February 11, 2016 13:52 — forked from radupotop/Interview.js
Interview
/*
1. Whats the difference between a local and a global variable. Implement a bug that could be
caused by accidentally forgetting to var a local variable
*/
/**
A global variable is found in the global scope, eg. the window object, and can
be accessed from any other scope.
A local variable is contained within the scope of a function and can only be
Note to the future me: above all the things, remember to look into the "--help" before looking other places ...