Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| # requires root permissions in /usr/bin/ | |
| star = String.new | |
| 8.times { star += "*" } | |
| Star = "\n#{star * 3}\n" | |
| def newblock string | |
| puts "\n#{Star}#{string}#{Star}\n" | |
| end |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| import java.lang.reflect.Type; | |
| import android.util.Base64; | |
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; | |
| import com.google.gson.JsonDeserializationContext; | |
| import com.google.gson.JsonDeserializer; | |
| import com.google.gson.JsonElement; | |
| import com.google.gson.JsonParseException; |
| # Add to .bash_profile | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| } | |
| get_git_root() { | |
| basename $(git rev-parse --show-toplevel 2> /dev/null) 2> /dev/null | |
| } |
| package com.mirth.stevek.rxtest; | |
| import rx.Observable; | |
| import rx.functions.Action1; | |
| import rx.functions.Func1; | |
| import rx.functions.Func3; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.concurrent.*; |
| replaceInManifest = {variant, fromString, toString -> | |
| def flavor = variant.productFlavors.get(0) | |
| def buildtype = variant.buildType | |
| def manifestFile = "$buildDir/manifests/${flavor.name}/${buildtype.name}/AndroidManifest.xml" | |
| def updatedContent = new File(manifestFile).getText('UTF-8').replaceAll(fromString, toString) | |
| new File(manifestFile).write(updatedContent, 'UTF-8') | |
| } |
| //before running make sure you setup a GOPATH env variable and ran: "go get code.google.com/p/go.net/html" | |
| //to run: go run ioCrawler.go -url="http://developers.google.com/" | |
| //also try http://developer.android.com/index.html | |
| //output goo.gl links to try and redeem will be sent to foundLinks.txt | |
| //by the way there's an artificial "rate limit" in func crawler, you can lower that or raise it as you wish | |
| //You can also comment out the onlyGoogleRegex code if you don't want to limit to google.com/youtube | |
| //if you're getting I/O timeout errors, then you might need to increase the timeouts on line 231 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| actions=true | |
| ads=true | |
| analytics=true | |
| appindexing=true | |
| appstate=true | |
| auth=true | |
| cast=true | |
| common=true | |
| drive=false | |
| dynamic=true |
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |