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
class PushDissolveAnimationSegue: UIStoryboardSegue { | |
override func perform() { | |
let transition = CATransition() | |
transition.duration = 0.2 | |
transition.type = kCATransitionFade | |
self.sourceViewController.navigationController!.view.layer.addAnimation(transition, forKey: kCATransition) | |
self.sourceViewController.navigationController!.pushViewController(self.destinationViewController, animated: 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
extension Double { | |
/// Rounds the double to decimal places value | |
func roundToPlaces(places:Int) -> Double { | |
let divisor = pow(10.0, Double(places)) | |
return round(self * divisor) / divisor | |
} | |
} |
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
// | |
// Awareness.swift | |
// Edible | |
// | |
// Created by Fuxing on 7/5/15. | |
// Copyright (c) 2015 3Lines. All rights reserved. | |
// | |
import Foundation | |
import CoreLocation |
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
Table table = dynamoDB.getTable(UserActivity.Table.TableName); | |
Map<String, Object> valueMap = new HashMap<>(); | |
valueMap.put(":user_id", getUserId()); | |
valueMap.put(":state", UserActivity.STATE_ACTIVE); | |
valueMap.put(":type", type); | |
QuerySpec spec = new QuerySpec() | |
.withNameMap(new NameMap() | |
.with("#s", "State").with("#t", "Type")) |
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
# Check Status | |
sestatus | |
# Turn it on with -P flag | |
setsebool -P httpd_can_network_connect on | |
# Reboot Server to apply change | |
sudo reboot |
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
#!/usr/bin/env bash | |
# Use it like this ./docker-rebuild.sh name 80:80 | |
#chmod +x rebuild.sh | |
#./rebuild.sh | |
NAME=$1 | |
PORT=$2 | |
# Clean and Remove all |
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
const express = require('express') | |
const SamlStrategy = require('passport-saml').Strategy | |
const passport = require('passport') | |
const cookieSession = require('cookie-session') | |
const cookieParser = require('cookie-parser') | |
// Create express instance | |
const app = express() |
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 PatternSplit { | |
private final Pattern pattern; | |
/** | |
* @param pattern pattern for the splitter | |
*/ | |
private PatternSplit(Pattern pattern) { | |
this.pattern = pattern; | |
} |