This file contains hidden or 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
if (mService != null) { | |
LQSession session = mService.getSession(); | |
// Build your request | |
try { | |
JSONObject geonote = new JSONObject(); | |
geonote.put("text", "Test!"); | |
geonote.put("latitude", 45.5037078163837); | |
geonote.put("longitude", -122.622699737549); | |
geonote.put("radius", 467); |
This file contains hidden or 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
// After binding to the tracking service you can | |
// perform a simple POST request using the runAPIRequest | |
// method. | |
// | |
// We'll be updating the SDK to provide simpler runGetRequest | |
// and runPostRequest methods to abstract away some of this | |
// logic. | |
if (mService != null) { | |
LQSession session = mService.getSession(); |
This file contains hidden or 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
<!-- Server side code here --> | |
<?php | |
if ($_POST['action'] === 'logout') { | |
logout(); | |
} | |
?> | |
<!-- Client side code here --> | |
<form action="" method="post"> | |
<input type="hidden" name="action" value="logout" /> |
This file contains hidden or 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
find ~/android-sdk-mac_x86/platforms/ -type f \( -name "ic_menu_crop.png" -o -name "ic_menu_preferences.png" -o -name "ic_menu_share.png" -o -name "ic_menu_delete.png" -o -name "ic_menu_home.png" -o -name "ic_menu_refresh.png" \) | cp `grep -i "7.*ldpi"` . |
This file contains hidden or 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
/** | |
* <p>This method checks an HttpResponse for a Content-Range | |
* header and, if present, attempts to parse the instance-length | |
* from the header value.</p> | |
* <p>{@link http://tools.ietf.org/html/rfc2616#section-14.16}</p> | |
* | |
* @param response | |
* @return the total number of bytes for the instance, or a negative number if unknown. | |
*/ | |
public static long getInstanceLength(HttpResponse response) { |
This file contains hidden or 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
# This line goes in /etc/netatalk/afpd.conf | |
- -tcp -noddp -uamlist uams_guest.so,uams_dhx.so,uams_dhx2.so -nosavepassword | |
# The remaining lines go in /etc/netatalk/AppleVolumes.default | |
# The line below sets some DEFAULT, starting with Netatalk 2.1. | |
:DEFAULT: options:upriv,usedots | |
# Regular AFP share | |
/mnt/storage "Storage" cnidscheme:dbd options:usedots,upriv |
This file contains hidden or 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
<?php | |
class CSV { | |
protected $data; | |
/* | |
* @params array $columns | |
* @returns void | |
*/ | |
public function __construct($columns) { | |
$this->data = '"' . implode('","', $columns) . '"' . "\n"; |
This file contains hidden or 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
def search(needle, haystack, end=False): | |
""" | |
A naive string searching function. | |
""" | |
n = len(needle) | |
h = len(haystack) | |
start = 0 | |
offset = n |
This file contains hidden or 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
function search(str1, str2) { | |
var i,n; | |
for (i=0; i<str2.length; i++) { | |
for (n=0; n<str1.length; n++) { | |
var c1 = str1.charAt(n); | |
var c2 = str2.charAt(i+n); | |
if (c1 === c2) { | |
if (n === (str1.length-1)) { | |
return i; | |
} |
This file contains hidden or 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/bash | |
## | |
# Install requirements for Apache2, MySQL, PHP, Django, Rails | |
# on Debian/Ubuntu. | |
## | |
sudo apt-get install \ | |
apache2 \ | |
apache2-doc \ | |
apache2-suexec \ | |
sqlite3 \ |