-
across all sections:
- changed all occurrences of the
a..b
operator toa..<b
- changed all occurrences of a
Something[]
array type to[Something]
- changed some occurrences of an
Array(values)
array initialization to[Something](values)
- changed some occurrences of a
Dictionary<Key, Value>
dictionary type to[Key: Value]
- changed all occurrences of the
-
Swift Tour:
- added a line:
/* | |
MKAnnotationView has one init listed in its documentation, initWithAnnotation:reuseIdentifier:, so let's override that. | |
But this causes a runtime exception: | |
fatal error: use of unimplemented initializer 'init(frame:)' for class 'PulsatingDotMarker' | |
*/ | |
class PulsatingDotMarker: MKAnnotationView { | |
let innerCircle: UIView |
How to lose at poker (Mike Lee, @bmf)
- emotion/intuition vs. reason in cards - those who ultimately win are not those who follow their intuition and emotions, but those who resist the temptation to do that; e.g. an "inside straight" (5 6 x 8 9) is twice harder to complete than other straights (x 5 6 7 8 x) even though it feels just as likely, so it's reckless to try to get one
- chance of failure is never 0%
- it's not about winning all the time, it's about managing your wins in a sea of losses, and using your losses to your advantage
#!/usr/bin/env ruby | |
STDIN.each_line do |line| | |
print line.gsub(/\b[A-Z]{2,}\b/) { |word| word.downcase } | |
end |
Otworzyło się ostatnio tyle nowych coworków, że nie nadążam tego odwiedzać :) Będę się starał stopniowo aktualizować listę, w międzyczasie polecam przeglądnąć komentarze pod postem. (Nie chcę szczerze mówiąc przenosić tego do jakiegoś bardziej zorganizowanego repozytorium, bo chcę, żeby to pozostało takim moim osobistym nieobiektywnym review tych coworków - ciężko byłoby uzgadniać, czy w danym miejscu jest głośno, albo czy jest fajna atmosfera... W razie wątpliwości, post jest dostępny na licencji WTFPL :)
Przydatne linki:
#!/bin/bash | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 <your_username> <contact_username>" | |
exit 1 | |
fi | |
echo "<!DOCTYPE html><html><head>" | |
echo "<style>" | |
echo "table { border-collapse: collapse; width: 800px; }" |
(This is mostly based on this post from 2000.)
There are two types of startups you can create. You have to know from the start which one it’s going to be. If you can't decide, or start using the rules from the wrong kind of startup, you’ll probably lose.
- Stack Overflow, Facebook, Yelp, Amazon, Trello
- has to grow quickly
- concentrates on getting as many users as possible in order to earn money in the future in some way
- relies on VC money
Javascript as language for native apps (Stepan Bechynsky)
- Windows RT - new system library for Windows apps, unified for Intel and ARM computers and tablets
- can be used from C++, C# (with XAML) or HTML/Javascript apps
- HTML/Javascript apps can access the whole RT API and standard browser API
- WinJS - Javascript bindings for WinRT and application framework
- Visual Studio 2012 is needed to build the app, but most of the work can be done on any OS, as it’s mostly just JS
- controls:
<div data-win-control="WinJS.UI.ToggleSwitch" data-win-options="{title: '...'}">
- access from JS to any system APIs, like camera capture, updating live tiles
package.appmanifest
- application config, e.g. permissions that the app requests from the user
#!/usr/bin/env ruby | |
consumer_key = ENV['KEY'] | |
consumer_secret = ENV['SECRET'] | |
unless consumer_key && consumer_secret | |
puts "Please set consumer key and secret from your Twitter app's settings: KEY=... SECRET=... ruby oauth_generator.rb" | |
exit 1 | |
end |
#!/bin/bash | |
FILE="$HOME/ip-monitor.txt" | |
OLD_IP=`cat $FILE` | |
CURRENT_IP=`curl -s http://curlmyip.com` | |
EMAILS="my.address@gmail.com" | |
SUBJECT="IP address changed" | |
FROM="IP Address Bot <root@localhost>" | |
if [ "$CURRENT_IP" ]; then |