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
package controllers; | |
import play.mvc.*; | |
import com.google.gson.*; | |
import models.*; | |
public class Application extends Controller { |
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
document.addEventListener("dragstart", function(event) | |
{ | |
event.dataTransfer.setData("image/png", slides.imageRep()); | |
event.dataTransfer.setData("slides", slides.serializedRep()); | |
// etc. | |
}, false); |
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 Global extends GlobalSettings { | |
@Override | |
public Action onRequest(Request arg0, Method arg1) { | |
return new Action.Simple() { | |
public Result call(Context ctx) throws Throwable { | |
String authConf = Config.getString("basic.auth"); | |
if (authConf == null) | |
return delegate.call(ctx); | |
String auth = ctx.request().getHeader("Authorization"); |
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
@interface NSManagedObject (Serialization) | |
- (NSDictionary*) toDictionary; | |
- (void) populateFromDictionary:(NSDictionary*)dict; | |
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
inContext:(NSManagedObjectContext*)context; | |
@end |
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
sudo chown -R `whoami` path/to/project/ | |
if that doesn't help, you can also try | |
sudo chown -R `whoami` ~/.cocoapods | |
sudo chown -R `whoami` ~/Library/Caches/CocoaPods |
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: Benjamin Weiss (keyboardsurfer) https://github.com/keyboardsurfer | |
# Under CC-BY-SA V3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode) | |
# built application files | |
*.apk | |
*.ap_ | |
*.jar | |
!gradle/wrapper/gradle-wrapper.jar | |
# lint folder |
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
########### Useful Commands ########### | |
# Download source code for Java API used in project | |
$ play "eclipse with-source=true" | |
# Run Play in https mode | |
$ JAVA_OPTS=-Dhttps.port=9001 play start | |
########### Useful Liberaries ########### | |
# Mongodb Wrapper for JAVA | |
http://jongo.org/ |
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
After requesting the certificate from Apple, export your private key as a .p12 file and | |
download the .cer file (usually named aps_production.cer or aps_development.cer) from | |
the iOS Provisioning Portal. | |
Now, in the directory containing cert.cer and key.p12 execute the following commands to | |
generate your .pem files: | |
openssl x509 -in aps_development.cer -inform DER -outform PEM -out aps_development.pem |
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
# Change the current branch to master in git # | |
You can rename/remove master on remote, but this will be an issue if lots of people have based their work on the remote master branch and have pulled that branch in their local repo. | |
That might not be the case here since everyone seems to be working on branch 'seotweaks'. | |
In that case you can: | |
(Make a git remote --show to check how your remote is declared within your local repo. I will assume 'origin') | |
(Regarding GitHub, house9 comments: "I had to do one additional step, click the 'Admin' button on GitHub and set the 'Default Branch' to something other than 'master', then put it back afterwards") |
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
// set path for the file to load in uiwebview | |
NSString *filePath = [resourceDir stringByAppendingPathComponent:@"index.html"]; | |
// convert to NSURL object, remember not to incoude #tag yet, as fileURLWithPath will replacce jquery # with %23 | |
// and will cause trouble to load your page properly | |
NSURL *fileURL = [NSURL fileURLWithPath:menuPath]; | |
// add hash here | |
fileURL = [NSURL URLWithString:@"#menu" relativeToURL:fileURL]; |
OlderNewer