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
from graphviz import Digraph | |
dot = Digraph(comment='Hunting Jobs') | |
dot.node('A', 'You') | |
dot.node('B', '50% - You decide to apply for a job') | |
dot.node('C', '50% - You decide to n\'t Apply to job') | |
dot.node('D', '20% - Pass Screening') | |
dot.node('E', '80% - Don\'t pass screening') |
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
""" | |
The basic idea is that I loop through all characters and count the number of | |
pixels and make <Hashtable number of pixels as a key and character as value> | |
The table will not have 255 value so to cover this I had to calculate the | |
slope of change as a base step for the colors. | |
example, if we have 50 value and we need 255 value, then each 255/50 = 5.1 | |
Then with each gray color we will devied by 5 so we have index to | |
be fetched from the keys of the pixels table |
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 UIView { | |
func viewHierarchy(views: [UIView], prefix: String) { | |
for view in views { | |
print("\(spaces)-\(view)") | |
viewHierarchy(view.subviews, spaces + " ") | |
} | |
func ancestry(view: UIView) { | |
var v: UIView? = view | |
var output = [UIView]() |
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
@protocol DataModalMarker | |
@end | |
@interface DataModalFiller : NSObject | |
+ (instancetype)sharedInstance; | |
- (id)deserilize:(id)target; | |
@end | |
#import "DataModalFiller.h" |
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 checkOverFlow(a: UInt32, b: UInt32) -> Bool{ | |
let c = 0xFFFFFFFF - a | |
return c < b; | |
} | |
print("\(checkOverFlow(a: 0xFFFFFFFF, b: 1))") |
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 Node<T> { | |
var left: Node? | |
var right: Node? | |
var value: T | |
init(value: T, left: Node<T>?, right: Node<T>?) { | |
self.value = value | |
self.left = left | |
self.right = right | |
} |
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
from AppKit import NSWorkspace | |
from time import sleep | |
from time import time | |
import sys | |
if len(sys.argv) != 2: | |
sys.exit("Usage: SCRIPT output_file.txt") | |
file = open(sys.argv[1],"a") | |
lastname = "" |
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://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ | |
set -g history-limit 300000 | |
bind | split-window -h | |
bind - split-window -v | |
unbind '"' | |
unbind % | |
bind r source-file ~/.tmux.conf |
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
""" | |
The basic idea is that I loop through all characters and count the number of | |
pixels and make <Hashtable number of pixels as a key and character as value> | |
The table will not have 255 value so to cover this I had to calculate the | |
slope of change as a base step for the colors. | |
example, if we have 50 value and we need 255 value, then each 255/50 = 5.1 | |
Then with each gray color we will devied by 5 so we have index to | |
be fetched from the keys of the pixels table |
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
# this code is compatible with Python 2.x | |
from pprint import pprint | |
sample = {"n":{"n":{"n":{"v":1},"v":2},"v":3},"v":4} | |
def reverseLinkedList(lst): | |
previous = None | |
current = lst | |
while current != None: | |
if "n" in current: |