Skip to content

Instantly share code, notes, and snippets.

View Default (OSX).sublime-keymap
[
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
]
@reisub
reisub / ImageIntentActivity.java
Last active Feb 2, 2017
Intent to choose image from gallery / capture new image via camera
View ImageIntentActivity.java
private static final int RC_CHOOSE_IMAGE = 0x33;
@OnClick(R.id.newProfileImageButton)
public void onImageSelectionButtonClicked() {
// TODO camera permission handling
Intent pickIntent = new Intent();
pickIntent.setType("image/*");
pickIntent.setAction(Intent.ACTION_GET_CONTENT);
@reisub
reisub / ClickToSelectEditText.java
Last active Aug 10, 2017 — forked from rodrigohenriques/ClickToSelectEditText.java
Used to make your EditText a better option than Spinners
View ClickToSelectEditText.java
public class ClickToSelectEditText<T extends Listable> extends AppCompatEditText {
List<T> items;
String[] listableItems;
CharSequence hint;
OnItemSelectedListener<T> onItemSelectedListener;
@reisub
reisub / log.txt
Last active Dec 5, 2016
Benchmarking compile speed depending on the used memory / swap. AVG 65 seconds vs 87 seconds.
View log.txt
➜ mLoterija git:(dev) memory_benchmark.sh
Memory used: 3.39G / 8.00G
Swap used: 0.83G / 2.00G
Making sure the basic apps for alt-tabbbing are running ...
Warming up by compiling once ...
BUILD SUCCESSFUL
View letsencrypt.service
# /etc/systemd/system/letsencrypt.service
[Unit]
Description=Renews letsencrypt certificates
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --quiet
View example.com
# HTTP
server {
server_name example.com www.example.com;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl http2;
View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
;; To run as daemon, follow instructions at http://www.emacswiki.org/emacs/EmacsAsDaemon#toc7
;; and run with emacsclient -nw (alias it to emacs)
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
View keybase.md

Keybase proof

I hereby claim:

  • I am reisub on github.
  • I am dino_kovac (https://keybase.io/dino_kovac) on keybase.
  • I have a public key ASDjRLKia8PlTVhq4TrhoXoDvU1OEHEFKL1qz5t9TyuPGgo

To claim this, I am signing this object: