This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String computeMD5Hash(String password){ | |
StringBuffer MD5Hash = new StringBuffer(); | |
try { | |
// Create MD5 Hash | |
MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); | |
digest.update(password.getBytes()); | |
byte messageDigest[] = digest.digest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static OkHttpClient getUnsafeOkHttpClient() { | |
try { | |
// Create a trust manager that does not validate certificate chains | |
final TrustManager[] trustAllCerts = new TrustManager[] { | |
new X509TrustManager() { | |
@Override | |
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sergi Tur Badenas | |
* http://acacha.org/sergitur | |
* See http://acacha.org/mediawiki/index.php/Android_AccountManager | |
* for more info | |
*/ | |
import android.accounts.Account; | |
import android.accounts.AccountManager; | |
import android.content.Context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void debugIntent(Intent intent, String tag) { | |
Log.v(tag, "action: " + intent.getAction()); | |
Log.v(tag, "component: " + intent.getComponent()); | |
Bundle extras = intent.getExtras(); | |
if (extras != null) { | |
for (String key: extras.keySet()) { | |
Log.v(tag, "key [" + key + "]: " + | |
extras.get(key)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_composer() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
local cmd=${COMP_WORDS[0]} | |
if ($cmd > /dev/null 2>&1) | |
then | |
COMPREPLY=( $(compgen -W "$($cmd list --raw | cut -f 1 -d " " | tr "\n" " ")" -- $cur) ) | |
fi | |
} | |
complete -F _composer composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getPermissionNameSuffix(Model $model) { | |
return strtolower((new ReflectionClass($model))->getShortName()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************ | |
* File Name : Smart_table_lamp.ino | |
* Author : crazyfeng | |
* Version : V1.0 | |
* Date : 18/07/2014 | |
*Parts required : Smart_table_lamp | |
* Description :The lamp can light up when someone make sound or go through. | |
* The Brightness of the lamp is adjustable. | |
* License : CC-BY-SA 3.0 | |
* Copyright (C) 2013 Maker Works Technology Co., Ltd. All right reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USER=acacha;PAGE=1; curl "https://api.github.com/users/$USER/repos?page=$PAGE&per_page=100" | grep -e 'git_url*' | cut -d \" -f 4 | xargs -L1 git clone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Firmata is a generic protocol for communicating with microcontrollers | |
from software on a host computer. It is intended to work with | |
any host computer software package. | |
To download a host software package, please clink on the following link | |
to open the list of Firmata client libraries your default browser. | |
https://github.com/firmata/arduino#firmata-client-libraries |
OlderNewer