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
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.notion.so/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-2.2.4.min.js | |
// ==/UserScript== |
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
<?php | |
/* | |
* Warning! Read and use at your own risk! | |
* | |
* This tiny proxy script is completely transparent and it passes | |
* all requests and headers without any checking of any kind. | |
* The same happens with JSON data. They are simply forwarded. | |
* | |
* This is just an easy and convenient solution for the AJAX |
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
import java.util.List; | |
import retrofit.RequestInterceptor; | |
import retrofit.RestAdapter; | |
import retrofit.http.Body; | |
import retrofit.http.GET; | |
import retrofit.http.POST; | |
import retrofit.http.PUT; | |
import retrofit.http.Path; |
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
.text-xs-left { text-align: left; } | |
.text-xs-right { text-align: right; } | |
.text-xs-center { text-align: center; } | |
.text-xs-justify { text-align: justify; } | |
@media (min-width: 768px) { | |
.text-sm-left { text-align: left; } | |
.text-sm-right { text-align: right; } | |
.text-sm-center { text-align: center; } | |
.text-sm-justify { text-align: justify; } |
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
<?php | |
namespace Example\ApiBundle\Controller; | |
use FOS\RestBundle\Controller\FOSRestController; | |
use FOS\RestBundle\View\View; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Serializer\Exception\LogicException; | |
use Symfony\Component\Validator\ConstraintViolation; |
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
import Foundation | |
infix operator =~ {} | |
func =~ (input: String, pattern: String) -> Bool { | |
return Regex(pattern).test(input) | |
} | |
class Regex { | |
let internalExpression: NSRegularExpression |
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
override func viewWillAppear(animated: Bool) { | |
super.viewWillAppear(animated) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWasShown:", name: UIKeyboardWillShowNotification, object: nil) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillBeHidden:", name: UIKeyboardWillHideNotification, object: nil) | |
} | |
override func viewWillDisappear(animated: Bool) { | |
NSNotificationCenter.defaultCenter().removeObserver(self) | |
} |
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 String | |
{ | |
var length: Int { | |
get { | |
return count(self) | |
} | |
} | |
func contains(s: String) -> Bool | |
{ |
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
func viewDidLoad() { | |
super.viewDidLoad() | |
// Register to this notifications for handle reduction of the app | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("appWillResignActive"), name: UIApplicationWillResignActiveNotification, object: nil) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("appWillTerminate"), name: UIApplicationWillTerminateNotification, object: nil) | |
// Call end editing when the user tap on the screen but not in the keyboard or the text edit | |
var tapGesture = UITapGestureRecognizer(target: self, action: Selector("endEditing:")) | |
// prevents the scroll view from swallowing up the touch event of child buttons |
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 ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate { | |
@IBOutlet weak var dividerPickerViewContainer: UIView! | |
var dividerPickerView: UIPickerView = UIPickerView() | |
override func viewDidLoad() { | |
// dividerPicker | |
self.dividerPickerView.delegate = self | |
self.dividerPickerView.dataSource = self |
NewerOlder