I came across this issue while I was working on a functional test for JAMLive!, a Play! application I'm currently working on obsessing over in my free time. I have a controller with a connect
method that looks like this:
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
// Required Modules | |
var webdriver = require('wd') | |
, assert = require('assert') | |
, fs = require('fs') | |
, mkdirp = require('mkdirp'); | |
// Define the strings for landscape & portrait | |
var PORTRAIT = "PORTRAIT"; | |
var LANDSCAPE = "LANDSCAPE"; | |
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/sh | |
# one way (older scala version will be installed) | |
# sudo apt-get install scala | |
#2nd way | |
sudo apt-get remove scala-library scala | |
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb | |
sudo dpkg -i scala-2.11.4.deb | |
sudo apt-get update |
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
private val service = { | |
val baseBuilder = | |
APNS.newService().asPool(maxConnections). | |
asBatched(batchWaitTimeInSec, maxBatchWaitTimeInSec). | |
withCert(getClass.getResourceAsStream(certPath), certPassword). | |
withDelegate(new ApnsDelegate { | |
override def connectionClosed(e: DeliveryError, messageId: Int) { | |
logger.error(s"ConnectionClosed MessageID: $messageId Error: $e") | |
} | |
override def cacheLengthExceeded(newCacheLength: Int) { |
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 is example code for influencer notification using FullContact on node.js | |
# Programming language used here is iced-coffee-script | |
# Author: Maptia | |
# License: public domain | |
_ = require 'underscore' | |
iced = require('iced-coffee-script').iced | |
request = require 'request' | |
fullContactAPIKey = '<your-fullcontact-api-key>' |
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
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
- To add Settings.bundle in Xcode. Command N and in Resource, choose Settings Bundle .
- Open
Root.plist
in source code, paste the code below to replace it,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
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 <UIKit/UIKit.h> | |
@interface UIView (SMFrameAdditions) | |
@property (nonatomic, assign) CGPoint $origin; | |
@property (nonatomic, assign) CGSize $size; | |
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties | |
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect | |
@end |
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 (Meteor.is_client) { | |
var Router = Backbone.Router.extend({ | |
routes: { | |
"" : "main", | |
":page": "main" //this will be http://your_domain/ | |
}, | |
main: function(page) { | |
document.body.innerHTML = ""; | |
page = page?page:"index"; | |
var frag = Meteor.ui.render(function () { |
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
Copyright [2012] [Gianluca Tessarolo] | |
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, |