Skip to content

Instantly share code, notes, and snippets.

@paddycarver
paddycarver / crx-build.sh
Created February 10, 2011 11:26
A bash script that compiles Google Chrome extension folders into .crx files
#!/bin/bash -e
#
# Purpose: Pack a Chromium extension directory into crx format
if test $# -ne 2; then
echo "Usage: crxmake.sh <extension dir> <pem path>"
exit 1
fi
dir=$1
String sdCard = android.os.Environment.getExternalStorageDirectory().getPath();
String root = sdCard + "/com.yourapp/";
public static void makeDir(String dir){
File fileObj = new File(root+dir);
fileObj.mkdir();
}
public static void sdCardMountCheck() {
String state = android.os.Environment.getExternalStorageState();
if(android.os.Environment.MEDIA_MOUNTED.equals(state)) {
sdCardReadable = true;
sdCardWritable = true;
}else if(android.os.Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
sdCardReadable = true;
sdCardWritable = false;
}else{
sdCardReadable = false;
package com.suchagit.android2cloud.util;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
package com.suchagit.android2cloud.util;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicNameValuePair;
public class AddLinkRequest extends HttpPost {
@paddycarver
paddycarver / fibonacci.php
Created January 16, 2012 13:27
Basic php worker for IronWorker.
<?php
$payload = “”;
for($k=0; $k < count($argv); $k++) {
if($argv[$k] == “-payload”) {
$payload = $argv[$k+1];
break;
}
}
@paddycarver
paddycarver / gist:1684188
Created January 26, 2012 18:23
IronWorker and Heroku documentation

IronWorker is a massively scalable task queue/job queue that makes it easy for you offload front end tasks, run background jobs, and process many tasks at once -- all in the cloud and with no servers to set-up and manage. It can also function as a cron-in-the-cloud service, running tasks on a schedule you define.

IronWorker has partnered with Heroku to make using both services together even easier.

Get Started

It's quick and easy to get IronWorker set up and running on Heroku. Note that IronWorker currently requires Ruby 1.9.2 or later. Please check the Heroku documentation to find out whether your stack is supported and how to select a supported stack.

Once you have a stack selected, you need to install the IronWorker add-on for Heroku. You can do this with a quick command:

@paddycarver
paddycarver / iron_mq.md
Created February 8, 2012 15:53
Heroku Iron docs update

IronMQ is a massively scalable messaging queue that makes it easy for you to keep a resilient and synchronised message-passing system in the cloud, between any number of clients, without server set-up or maintenance. It makes managing data and event flow within your application simple.

Iron has partnered with Heroku to make using both services together even easier.

Get Started

It's quick and easy to get IronMQ set up and running on Heroku. You just need to install the IronMQ add-on for Heroku. You can do this with the heroku command:

:::term

$ heroku addons:add iron_mq:rust

@paddycarver
paddycarver / browser_check.html
Created April 24, 2012 12:27
Canisius Browser Check Page
<html>
<head>
<!-- written by an intern from the past. Email foran.paddy@gmail.com for help if things go wrong or need updating. -->
<title>Browser Check</title>
<style type="text/css">
body {
font-family: arial;
}
#checkContainer {
min-width: 275px;
--39f5903459794ad483153244cc6486ec
Content-Disposition: form-data; name="data"
Content-Type: application/json
{"name":"NodeWorker","file_name":"__runner__.sh","runtime":"sh"}
--39f5903459794ad483153244cc6486ec
Content-Disposition: form-data; name="file"; filename="worker.zip"
Content-Type: application/zip
__runner__.shUX