Community
Cheatsheets
- GenServer Cheatsheet by Benjamin Tan Wei Hao
Books
Community
Cheatsheets
Books
| /* | |
| * 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 |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.BaseAdapter; | |
| import io.realm.RealmObject; | |
| import io.realm.RealmResults; | |
| public abstract class RealmAdapter<E extends RealmObject, VH extends RealmAdapter.ViewHolder> | |
| extends BaseAdapter { |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| # | |
| # How to install automatically Oracle Java 7 under Salt Stack | |
| # | |
| # Thanks Oracle for complicating things :( | |
| # | |
| # 1. Create a java/ folder in your salt master | |
| # 2. Paste this file in init.sls | |
| # 3. salt '*' state.sls java | |
| # | |
| # Source: |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| #!/bin/sh | |
| # Credits to: | |
| # - http://vstone.eu/reducing-vagrant-box-size/ | |
| # - https://github.com/mitchellh/vagrant/issues/343 | |
| aptitude -y purge ri | |
| aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide | |
| aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30 | |
| aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5 |
| #! /usr/bin/env python | |
| import fileinput | |
| import argparse | |
| from operator import itemgetter | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int) | |
| parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+') | |
| args = parser.parse_args() |
| module Jekyll | |
| # Expects a lessc: key in your _config.yml file with the path to a local less.js/bin/lessc | |
| # Less.js will require node.js to be installed | |
| class LessJsGenerator < Generator | |
| safe true | |
| priority :low | |
| def generate(site) | |
| src_root = site.config['source'] |