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
package server; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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
import( | |
"compress/flate" | |
"os" | |
"io" | |
) | |
func main(){ | |
inFile,err := os.Open("something.txt",os.O_RDONLY,0666) | |
if err != nil { panic(err.String())} | |
defer inFile.Close() |
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 | |
cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/ | |
dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255 | |
printf "\x8f\x2a\x00\x00" >> working | |
dd if=iPhoneOS\ Build\ System\ Support of=working bs=1 skip=127504 seek=127504 | |
/bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original | |
/bin/mv working iPhoneOS\ Build\ System\ Support | |
chmod a+x iPhoneOS\ Build\ System\ Support | |
mkdir /Developer/iphoneentitlements30 |
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
- (void)centerMap { | |
NSArray *coordinates = [self.mapView valueForKeyPath:@"annotations.coordinate"]; | |
CLLocationCoordinate2D maxCoord = {-90.0f, -180.0f}; | |
CLLocationCoordinate2D minCoord = {90.0f, 180.0f}; | |
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
/***** | |
To authorize on Twitter API through xAuth, you need HMAC-SHA1 | |
I'm using the following lib for that: | |
http://jssha.sourceforge.net | |
Make sure you have sha.js included! | |
<script src="http://jssha.sourceforge.net/sha.js"></script> | |
Also, you need to email [email protected] to get xAuth access | |
I cannot do that for you - see http://dev.twitter.com/pages/xauth | |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta name="viewport" content="width=320; user-scalable=no" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>PhoneGap</title> | |
<link rel="stylesheet" href="/master.css" type="text/css" media="screen" title="no title" charset="utf-8"> | |
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script> | |
<script type="text/javascript" src="jquery.1.3.2.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> |
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 | |
function http_get($host) { | |
// create event base | |
$base_fd = event_base_new(); | |
// create a new event | |
$event_fd = event_new(); | |
// resource to be monitored |
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
configuration = ENV["CONFIGURATION"] | |
project_dir = ENV["PROJECT_DIR"] | |
settings_bundle = "#{project_dir}/Resources/Settings.bundle" | |
plist_location = "#{project_dir}/Resources/SettingPlists" | |
release_or_debug = ENV["CONFIGURATION"] == "Debug" ? "Debug" : "Release" | |
settings_plist = "#{plist_location}/SettingsRoot#{release_or_debug}.plist" | |
system("cp #{settings_plist} #{settings_bundle}/Root.plist"); | |
system("touch #{settings_bundle}/Root.plist"); |
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 | |
# According to https://developer.apple.com/library/ios/#qa/qa1686/_index.html | |
# Install GraphicsMagick with Homebrew: brew install GraphicsMagick | |
gm convert $1 -resize 512x512 iTunesArtwork.png # Ad Hoc iTunes | |
gm convert $1 -resize 144x144 [email protected] # Home screen for "The New iPad" | |
gm convert $1 -resize 114x114 [email protected] # Home screen for Retina display iPhone/iPod | |
gm convert $1 -resize 72x72 Icon-72.png # App Store and Home screen on iPad | |
gm convert $1 -resize 58x58 [email protected] # Spotlight and Settings for Retina display | |
gm convert $1 -resize 57x57 Icon.png # Home screen on non-Retina iPhone/iPod | |
gm convert $1 -resize 50x50 Icon-Small-50.png # Spotlight on iPad 1/2 |
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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
OlderNewer