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 requests | |
import json | |
import uuid | |
import time | |
from requests import Request, Session | |
# this is the initial call to get cookies and shit | |
s = Session() | |
r1 = s.get('https://challengethefuture.postfinance.ch/Contest/2') | |
totals = [] |
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 UserDefaults { | |
func color(forKey defaultName: String) -> UIColor? { | |
var color: UIColor? | |
if let colorData = data(forKey: defaultName) { | |
color = NSKeyedUnarchiver.unarchiveObject(with: colorData) as? UIColor | |
} | |
return color | |
} | |
func set(_ value: UIColor?, forKey defaultName: String) { |
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 requests | |
import json | |
import time | |
import os | |
from datetime import datetime | |
stat = "" | |
while True: | |
r = requests.get("https://www.googleapis.com/youtube/v3/channels?part=statistics&id=$$$CHANNEL_ID$$$&key=$$$YOUR_API_KEY$$$") | |
j = json.loads(r.content) |
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
var textReco: [CGRect] { | |
get { | |
return _backingTextReco.map { CGRectFromString($0.stringValue) } | |
} | |
set { | |
_backingTextReco.removeAll() | |
_backingTextReco.appendContentsOf(newValue.map({ RealmString(value: [NSStringFromCGRect($0)]) })) | |
} | |
} | |
let _backingTextReco = List<RealmString>() |
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
CGFloat topLetterPadding = self.nameLabel.font.ascender - self.nameLabel.font.capHeight; | |
NSLayoutConstraint *nameLabelCenterConstraint = [NSLayoutConstraint constraintWithItem:self.nameLabel | |
attribute:NSLayoutAttributeCenterY | |
relatedBy:NSLayoutRelationEqual | |
toItem:self | |
attribute:NSLayoutAttributeCenterY | |
multiplier:1 | |
constant:roundf(-(topLetterPadding / 2))]; |
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
_levelNr = 5; | |
delay = 100; | |
function exec() { | |
// new function -> getX(); and getY(); | |
// use these to check that you don't leave the playing field | |
var check = 9; | |
for (var i = 0; i < 200; i++) { |
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
var Firebase = require("firebase"); | |
var lunr = require("lunr"); | |
var http = require('http'); | |
var url = require('url'); | |
var index = lunr(function () { | |
this.field('title', {boost: 10}) | |
this.field('description') | |
this.ref('id') | |
}) |
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
static CGFloat kHeight = 480; | |
@implementation ModalViewController { | |
UIView *_bg; | |
UIView *_container; | |
} | |
- (instancetype)init { | |
if (self = [super init]) { | |
self.providesPresentationContextTransitionStyle = YES; |
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
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Title" | |
message:nil | |
preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction * action) {}]; | |
_saveAlertAction = [UIAlertAction actionWithTitle:@"Save" style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction * action) { | |
}]; | |
_saveAlertAction.enabled = NO; |
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
http = require('http'); | |
fs = require('fs'); | |
url = require('url'); | |
server = http.createServer( function(req, res) { | |
console.log(req.url) | |
if (req.method == 'POST') { | |
var body = ''; | |
req.on('data', function (data) { | |
body += data; |
NewerOlder