(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.
public class SignUpActivity extends Activity { | |
private final ObjectGraph childOg; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState): | |
ExampleApp app = (ExampleApp) getApplication(); | |
ObjectGraph og = app.getObjectGraph(); |
(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.
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)#!/bin/bash | |
usage() { | |
cat << EOF | |
Usage: $0 [OPTION]... COMMAND | |
Execute the given command in a way that works safely with cron. This should | |
typically be used inside of a cron job definition like so: | |
* * * * * $(which "$0") [OPTION]... COMMAND | |
Arguments: |
#!/bin/bash | |
# Android 4.3+ changes app's internal directory permissions and you can not just pull your | |
# databases to your computer, so I did this as a workaround to extract my databases. | |
# I only use it for debug, use it under your responsability. | |
package=$1 | |
db_name=$2 | |
path="/data/data/$package/" |
#!/bin/bash | |
f=$(pwd) | |
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi | |
# fake argv and argc in bash | |
argc=$#; argv[0]=$0 # argv[0] is a prog name | |
for foo in $( seq $argc ) | |
do |
#!/bin/sh | |
############# | |
# This is my fork of consti/post-commit gist: https://gist.github.com/consti/3082406 | |
# It uses a more human date naming and stores captures from same repo to same directory. | |
# I have also added branch name at filename. | |
############# | |
# | |
# Take a photo of you, whenever you make a commit |
import jenkins.model.Jenkins | |
build = Jenkins.instance.items[0].builds[0] | |
println build | |
println("Available actions on the build: " + build.actions) | |
def analysisCoreActions = [] | |
// All static analysis actions based on static analysis core can be handled uniformly | |
analysisCoreActions.addAll(build.actions.findAll{it.class.name =~ "hudson.plugins.checkstyle.CheckStyle.*ResultAction"}) |
import json | |
import boto | |
from django.db import models | |
from django.conf import settings | |
from django.contrib.auth.models import User | |
class UploadToken(models.Model): | |
user = models.ForeignKey(User) | |
created = models.DateTimeField(auto_now_add=True) |