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
extension UIColor { | |
class func random() -> UIColor { | |
let r: CGFloat = CGFloat(drand48()) | |
let g: CGFloat = CGFloat(drand48()) | |
let b: CGFloat = CGFloat(drand48()) | |
return UIColor(red: r, green: g, blue: b, alpha: 1) | |
} | |
} |
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 com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
class Response { | |
protected String message; | |
protected int status; | |
public String getMessage() { | |
return message; | |
} |
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
package fazlamesai.com.myapplication; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.util.Log; | |
import java.io.BufferedInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; |
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
package main | |
import ( | |
"encoding/json" | |
"net/http" | |
"strings" | |
) | |
func main() { | |
http.HandleFunc("/weather/", func(w http.ResponseWriter, r *http.Request) { |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
pip install networkx distance pattern | |
In Flipboard's article[1], they kindly divulge their interpretation | |
of the summarization technique called LexRank[2]. |
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
// Playground - noun: a place where people can play | |
import UIKit | |
// Data -> JSON? | |
// JSON -> Cafe? | |
enum JSONValue { | |
case JSONObject([String:JSONValue]) | |
case JSONArray([JSONValue]) |
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
.directive('fmVideo', function() { | |
var clearContainer = function(element) { | |
element.find('video').each(function(_, el) { | |
el.pause(); | |
el.src = ""; | |
}); | |
element.empty(); | |
}; | |
return { |
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
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
UITouch *touch = [touches anyObject]; | |
if (self.fingerIsOnWheel) { | |
CGPoint touchLocation = [touch locationInNode:self]; | |
CGPoint previousLocation = [touch previousLocationInNode:self]; | |
CGFloat angle1 = [self angleBetweenFirstPoint:previousLocation secondPoint:CGPointZero]; | |
CGFloat angle2 = [self angleBetweenFirstPoint:touchLocation secondPoint:CGPointZero]; | |
CGFloat bearingRadians = angle2 - angle1; |
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
// | |
// main.cpp | |
// CppDatabase | |
// | |
// Created by Haldun Bayhantopcu on 23/04/14. | |
// Copyright (c) 2014 Monoid. All rights reserved. | |
// | |
#include <iostream> | |
#include <memory> |
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
ssh -f -N -R 3000:127.0.0.1:3000 hb@ |