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
var fs = require('fs'), | |
sys = require('sys'), | |
http = require('http'); | |
http.createServer(function (req, res) { | |
checkBalanceFile(req, res); | |
}).listen(8000); | |
function checkBalanceFile(req, res) { | |
fs.stat("balance", function(err) { |
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
class PInfo { | |
private String appname = ""; | |
private String pname = ""; | |
private String versionName = ""; | |
private int versionCode = 0; | |
private Drawable icon; | |
private void prettyPrint() { | |
Log.v(appname + "\t" + pname + "\t" + versionName + "\t" + versionCode); | |
} | |
} |
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
// Determine which activities can handle the intent | |
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); | |
PackageManager packageManager = getContext().getPackageManager(); | |
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0); | |
// If there are no relevant activities, don't follow the link | |
boolean isIntentSafe = activities.size() > 0; | |
if (!isIntentSafe) { | |
// Something Wrong | |
return true; |
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
#!/bin/sh | |
# | |
# Install RabbitMQ on RHEL/CentOS 5 | |
# | |
# Enable EPEL | |
wget -O /tmp/epel-release-5-4.noarch.rpm http://ftp.riken.jp/Linux/fedora/epel/5/i386/epel-release-5-4.noarch.rpm | |
rpm -ivh /tmp/epel-release-5-4.noarch.rpm |
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
var conf = require('./config.js') | |
, wp = require('wordpress') | |
; | |
// TODO Account Validation | |
// TODO Make Output Directories | |
// | |
// Client Instance |
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
buildscript { | |
repositories { | |
// rather than hit central each time with this: | |
// mavenCentral() | |
// we hit our company Nexus server ont he public group | |
// which includes the Central Repository | |
// and is local, so more performant | |
maven { | |
url "http://localhost:8081/nexus/content/groups/public" | |
} |
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
/* Your Android Config Here */ | |
/* Spoon Configuration */ | |
repositories { mavenCentral() } | |
configurations { spoon } | |
dependencies { spoon 'com.squareup.spoon:spoon-runner:1.0.5' } | |
def buildDirPath = project.buildDir.path | |
def apk = buildDirPath + '/apk/' + project.name + '-debug-unaligned.apk' |
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
// | |
// !!WARNING: Not recommended for production code!! | |
// | |
public class ClassLoaderActivity extends Activity | |
{ | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
// file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files | |
ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader()); | |
setAPKClassLoader(dexLoader); |
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 class Dexter { | |
private static String optimizedDirectory = "optimized"; | |
private static String workDirectory = "working"; | |
public static void loadFromAssets(Context context, String fileName) throws Exception { | |
File optimized = new File(optimizedDirectory); | |
optimized = context.getDir(optimized.toString(), Context.MODE_PRIVATE); | |
optimized = new File(optimized, fileName); |
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
Copyright (C) ${project.inceptionYear} ${owner} (${email}) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, |
OlderNewer