Skip to content

Instantly share code, notes, and snippets.

View amsterdatech's full-sized avatar
💭
I may be slow to respond.

William Gouvea amsterdatech

💭
I may be slow to respond.
View GitHub Profile
[user]
name = William Gouvea
email = william.gouvea@mobileaware.com
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[merge]
tool = diffmerge
Git to SVN
================
-Create users.txt with the format
schacon = Scott Chacon <schacon@geemail.com>
selse = Someo Nelse <selse@geemail.com>
@amsterdatech
amsterdatech / ComponentAliasManager.java
Created September 4, 2015 17:23
Enable Disable Component Alias
package com.amsterdatech.shortcutpoc;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.util.Log;
import java.lang.ref.WeakReference;
import java.net.URISyntaxException;
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
or
final PackageManager pm = getPackageManager();
//get a list of installed apps.
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
#!/usr/bin/env ruby
require 'fileutils'
prefix_input = ARGV[0]
prefix_output = ARGV[1]
suffixes = [".png", "@1.5x.png", "@2x.png", "@3x.png", "@4x.png"]
output_dirs = {
@amsterdatech
amsterdatech / http-ping.sh
Created February 18, 2020 04:21 — forked from henriquemenezes/http-ping.sh
HTTP Ping
function http-ping {
SLEEP=${2:-5}
while true; do echo "$(date +'%Y-%m-%d %H:%M:%S') - GET $1 - $(curl -sL -w "%{http_code}" -o /dev/null $1)"; sleep $SLEEP; done
}
@amsterdatech
amsterdatech / get_ip.sh
Created February 18, 2020 04:22 — forked from henriquemenezes/get_ip.sh
Get current IP addresses
#!/bin/sh
IP=""
OS=`uname`
case "${OS}" in
Linux)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
;;
FreeBSD|OpenBSD)
@amsterdatech
amsterdatech / vim.md
Created February 18, 2020 04:22 — forked from henriquemenezes/vim.md
Vim

Vimtutor:

Tips & Tricks

	:source $MYVIMRC	Reload .vimrc without restart vim, after reload run :e
	:e 			Reload buffer and trigger FileType event

Modes:

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
{
"objects":[
{
"name":"A - Blue Lines",
"bg":"https://firebasestorage.googleapis.com/v0/b/desafio-dev-android.appspot.com/o/assets%2F440-BlueLines.mp4?alt=media&token=4dea3d00-8d8c-4c3a-8489-5776392e4b0d",
"im":"https://firebasestorage.googleapis.com/v0/b/desafio-dev-android.appspot.com/o/assets%2F440-BlueLines.jpg?alt=media&token=4af49276-4880-4e61-9ce7-e183c77cfc2e",
"sg":"https://firebasestorage.googleapis.com/v0/b/desafio-dev-android.appspot.com/o/assets%2F01180-SP-Piano_One.mp3?alt=media&token=de332e78-7761-4e7b-8495-81fce22a0d65"
},
{
"name":"B - Dancing Glow",