Skip to content

Instantly share code, notes, and snippets.

View balazspete's full-sized avatar

Balázs Pete balazspete

View GitHub Profile
@balazspete
balazspete / set_up_opencv_on_mac
Last active May 21, 2016 14:12
How to: Set up OpenCV on MacOS X and XCode 5
###Download XCode from the App Store
Get it from [here](https://itunes.apple.com/en/app/xcode/id497799835?mt=12)
###Get cmake
Use/get a package manager, such as [homebrew](http://brew.sh/).
Open a terminal window and type the following
```
brew install cmake
```
This will get the required packages for *cmake*.
if [true,false].sample
#do something if true
else
#do some other thing
end
class Node
attr_reader :e, :t
def initialize b, d, approx, t=nil
random_t = lambda {|min, max| Random.rand(max - min)+min }
@t = (t or random_t.call(-250, 250))
@e = nil
end
serialize: (data) ->
("#{key}=#{value}" for key, value of data).link "&"
@balazspete
balazspete / gist:3849199
Created October 7, 2012 18:41
Parse URL
/((((?<!\"|>|href=|href\s=\s|href=\s|href\s=|src=|src\s=\s|src=\s|src\s=)((https?|s?ftp|telnet|mailto)\:\\/\\/))|(?<=\s))([\d\w-^\">]+\.)*?[\d\w-]+\.([a-z]{2,4}\.)*([a-z]{2,4})((\\/)([\d\w\\/\.\?\*\+_=;%&-])*)?)(?!(\w))/i
<br><span xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://subtlepatterns.com/" style="padding: 0px;width: 400px;left: 0px;"><span property="dct:title" style="position: relative;top: 0px;">Subtle Patterns</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://subtlepatterns.com">Subtle Patterns</a>) / <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA 3.0</a></span>