Skip to content

Instantly share code, notes, and snippets.

View goncalossilva's full-sized avatar

Gonçalo Silva goncalossilva

View GitHub Profile
@goncalossilva
goncalossilva / gifenc.sh
Last active December 12, 2023 22:31
Encode mp4, webm and gif using ffmpeg (2.6 or above). Audio is discarded on all of these!
#!/bin/sh
# sh gifenc.sh input.mp4 output.gif
# Optionally accepts width / height (one or both).
palette="/tmp/palette.png"
filters="fps=15"
if [ -n "$3" ]; then
if [ -n "$4" ]; then
filters="$filters,scale=$3:$4"
### Keybase proof
I hereby claim:
* I am goncalossilva on github.
* I am goncalossilva (https://keybase.io/goncalossilva) on keybase.
* I have a public key whose fingerprint is C272 B075 3313 6571 5980 70A5 4AC5 F859 0A77 0315
To claim this, I am signing this object:
dx --dex --num-threads=4 --output app/build/intermediates/dex/google/debug app/build/intermediates/classes/google/debug app/build/intermediates/dependency-cache/google/debug /build/intermediates/pre-dexed/google/debug/bugsense-3.6.1-dab08a48400319f720951c05a15093fa84d1639a.jar app/build/intermediates/pre-dexed/google/debug/classes-05334bb2a2664029bf7f4b2da6361c325c5476bf.jar app/build/intermediates/pre-dexed/google/debug/classes-200692cdc7d950e2e88177c4883b3f93381dd231.jar app/build/intermediates/pre-dexed/google/debug/classes-36539e46b9820907d51e2e52f0833f7c33debd3a.jar app/build/intermediates/pre-dexed/google/debug/classes-40a260ec86147cc79755d457bde057edb0f07abe.jar app/build/intermediates/pre-dexed/google/debug/classes-46ca0b7dc2b826d4414c2d3d0cacdc4c5257c6d8.jar app/build/intermediates/pre-dexed/google/debug/classes-5128cf04b649594e4626c110d0543bc798c591d0.jar app/build/intermediates/pre-dexed/google/debug/classes-57782c1351a42037a9d41431771c41ad7b72ae07.jar app/build/intermediates/pre-dexed/google/debug
@goncalossilva
goncalossilva / actionbarsherlock.build.gradle
Last active December 22, 2015 07:09
Dependencies project and libraries. Imaginary snippets based on the actual code, but greatly simplified
// ActionBarSherlock:actionbarsherlock's build.gradle snippet
dependencies {
compile 'com.android.support:support-v4:18.0.+'
}
class MyDrawerLayout extends DrawerLayout {
// ...
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
if(child instanceof ViewGroup) {
ViewGroup childVG = (ViewGroup)child;
if(childVG.getBackground() == null && childVG.getChildCount() == 1) {
View realChild = childVG.getChildAt(0);
curl --header "User-Agent: Todoist 43 (Android 4.2.2)" "https://android.todoist.com/TodoistSync/v2/syncAndGetUpdated" -- data-ascii 'client_id=android:APA91bFDt_EplQXjy7pdT1W5ePRyNB3Xvth7BikIWydUEWZqypOCDVp69prgOuQ4esiXLRrLP9UHRtyWFbZZJgy70mC8RbIyaaDWqwofF9pOU2lE9UI8NvzOVrzUsKGQOuFuBN7Rtz0VZe4Mt4yyPIy9WGdapVbbpw&project_timestamps={"102278254":"1370191597.14","99949946":"1370539607.95","108256199":"1370533717.63","100030395":"1370539577.4","100034513":"1369760135.84","102183937":"1369760135.84","99990400":"1369760135.84","107194585":"1369760135.84","102106782":"1369760135.84","108334364":"1370263687.65"}&labels_timestamp=1369760021.22&filters_timestamp=1368029514.05&day_orders_timestamp=1370539826.63&api_token=1465d018df51881e70191a8f62ac71e7cc00547a'
%(\d*\$|<)?((?:,|\+| |\(|-\d+|0\d+\#)*)?(\d*)?(\.\d*)?([a-zA-Z%\s])
!!\s*(.+)\s*!!
!!\s*([^!][^!]*)\s*!!
@goncalossilva
goncalossilva / .githookspre-commit
Created May 1, 2012 16:08
Don't commit conflicts
#!/usr/bin/env ruby
`git diff-index --name-status HEAD`.split("\n").each do
|status_with_filename|
status, filename = status_with_filename.split(/\s+/)
next if status == 'D'
File.open(filename) do |file|
while line = file.gets
if line.include?("<<<<<<<") || line.include?(">>>>>>>")
puts "ERROR: #{filename} has unresolved conflicts"