Dev Env Setup
- My steps todo: write a bash script to handle this
Github configs
Local preferences
| import Foundation | |
| import PlaygroundSupport | |
| URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil) | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| // Refer to the example: https://grokswift.com/simple-rest-with-swift/ | |
| let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todo/1" | |
| guard let url = URL(string: todoEndpoint) else { | |
| print("Error: cannot create URL") |
| #!/usr/bin/env python3 | |
| import argparse | |
| import difflib | |
| import subprocess | |
| EMOJI_UNICODE = { | |
| '+1': '\U0001F44D', | |
| '-1': '\U0001F44E', |
Dev Env Setup
Github configs
Local preferences
From a lecture by Professor John Ousterhout at Stanford.
Programmers tend to worry too much and too soon about performance. Many college-level Computer Science classes focus on fancy algorithms to improve performance, but in real life performance rarely matters. Most real-world programs run plenty fast enough on today's machines without any particular attention to performance. The real challenges are getting programs completed quickly, ensuring their quality, and managing the complexity of large applications. Thus the primary design criterion for software should be simplicity, not speed.
> Occasionally there will be parts of a program where performance matters, but you probably won't be able to predict where the performance issues will occur. If you try to optimize the performance of an application during the initial construction you will add complexity that will impact the timely delivery and quality o
04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.
This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.
[Laughter]
> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation
| var reverse = function(str) { | |
| var ans = [], | |
| arr = str.split(''); | |
| arr.forEach(function(chr) { | |
| ans.unshift(chr); | |
| }); | |
| return ans.join(''); | |
| }; |
| set dFolder to "~/Desktop/screencapture/" | |
| do shell script ("mkdir -p " & dFolder) | |
| set i to 0 | |
| repeat 960 times | |
| do shell script ("screencapture " & dFolder & "frame-" & i & ".png") | |
| delay 30 -- Wait for 30 seconds. | |
| set i to i + 1 | |
| end repeat |
| # -*- encoding: UTF-8 -*- | |
| require 'nokogiri' | |
| require 'open-uri' | |
| API_URL = "http://thecatapi.com/api/images/get?format=xml" | |
| doc = Nokogiri::XML(open(API_URL).read) | |
| url_nodes = doc.xpath("//url").text |
| // Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository | |
| $ git ls-files | xargs wc -l |