- http://donigian.blogspot.com, http://donigian.github.com
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
Here is an example how to build and run ApiDemos sample project. | |
Go to your SDK folder, then to ../samples/android-#/ApiDemos, where # is API Level. | |
Start terminal in this folder. | |
Run android list targets and find target with API Level that is equal or higher then what you've chosen for # on step 1. Lets call this target X. In my case X equals 21. It looks like in your case X equals 1. | |
Run android update project -p . -n ApiDemos -t X (change X to correct value) | |
Run ant debug | |
Run adb install bin/ApiDemos-debug.apk | |
Setting up a Device for Development |
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
Set up the submodule for the first time: | |
[~]$ cd ~/main/ | |
[main]$ git submodule add git://github.com/my/submodule.git ./subm | |
[main]$ git submodule update --init | |
[main]$ git commit ./submodule -m "Added submodule as ./subm" | |
Fetch submodules after cloning a repository: | |
[~]$ git clone git://github.com/my/main.git ~/main | |
[~]$ cd ~/main/ | |
[main]$ git submodule update --init | |
Pull upstream main repo changes and update submodule contents: |
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
sudo service postgresql restart | |
sudo service postgresql status | |
sudo service postgresql stop | |
sudo service postgresql status | |
sudo crontab -l | |
tail -f /var/log/postgresql/postgresql-9.1-main.log | |
/etc/services |
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
$ git checkout master && git pull | |
$ git checkout -b topic | |
-> Work a bit and commit changes | |
-> Preview changes from master | |
$ git checkout master # Think about checking out branch performing action to | |
$ git pull | |
$ git checkout topic | |
$ git rebase master | |
-> When unit & integration tests pass | |
$ git checkout master |
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
rmongodb Example | |
library(rmongodb) | |
mg2 <- mongo.create() | |
print(mongo.get.databases(mg2)) | |
print(mongo.get.database.collections(mg2, 'db')) | |
buf <- mongo.bson.buffer.create() | |
mongo.bson.buffer.start.object(buf, 'AGE') | |
mongo.bson.buffer.append(buf, '$lt', 10) | |
mongo.bson.buffer.finish.object(buf) |
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
function mk-scala-dir() { | |
mkdir -p src/main/{resources,scala} | |
mkdir -p test/{resources,scala} | |
mkdir -p project/ | |
touch build.sbt | |
printf 'name := "sample"\n\n' >> build.sbt | |
printf 'version := "0.0.1"\n\n' >>build.sbt | |
printf 'scalaVersion := "2.10.0"\n' >> build.sbt | |
touch project/build.properties |
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
def printFoo() = { | |
println("Func Foo invoked") | |
} | |
def callByValue(a: String) = { | |
println("a1=" + a) | |
println("a2=" + a) | |
} | |
def callByName(b: => String) = { |
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
scala> callByValue(printFoo()) | |
Func Foo invoked | |
a1="a1" | |
a2="a2" | |
scala> callByName(printFoo()) | |
Func Foo invoked | |
b1="b1" | |
Func Foo invoked | |
b2="b2" |
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
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
if [[ ${#} -ne 1 ]] | |
then | |
echo "Usage: ${0} upstart-conf-file" >&2 | |
exit 1 | |
fi |
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
✗ knife bootstrap localhost \ | |
--ssh-user vagrant \ | |
--ssh-password vagrant \ | |
--ssh-port 2222 \ | |
--run-list "recipe[apt]" \ | |
--sudo | |
Bootstrapping Chef on localhost | |
localhost --2013-12-19 21:47:47-- https://www.opscode.com/chef/install.sh | |
localhost Resolving www.opscode.com (www.opscode.com)... 184.106.28.91 | |
localhost Connecting to www.opscode.com (www.opscode.com)|184.106.28.91|:443... connected. |