Skip to content

Instantly share code, notes, and snippets.

View alejandrogr's full-sized avatar

Alejandro González alejandrogr

View GitHub Profile
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Tmux should be pretty, we need 256 color for that
set -g default-terminal "screen-256color"
[alias]
s = status -s -b
cp = cherry-pick
st = status -s
cl = clone
ci = commit
co = checkout
br = branch
diff = diff --word-diff
dc = diff --cached
#homes
alias home_repos='cd ~/repos && ll'
alias home_innotech='cd ~/repos/innotech && ll'
# aliases for Tmux
alias tmux='tmux -2'
alias ta='tmux attach -t'
alias tnew='tmux new -s'
alias tls='tmux ls'
alias tkill='tmux kill-session -t'
#general
@alejandrogr
alejandrogr / executeTaskInQueue.java
Last active November 17, 2018 13:06
Appengine JunitTest TaskLauncher
public static void executeTasksInQueue(String p_queue) throws InterruptedException, ServletException, IOException{
LocalTaskQueue ltq = LocalTaskQueueTestConfig.getLocalTaskQueue();
QueueStateInfo qsi = ltq.getQueueStateInfo().get(QueueFactory.getQueue(p_queue).getQueueName());
System.out.println("tasks in queue " + qsi.getTaskInfo().size());
int i, I = qsi.getTaskInfo().size();
for (i = 0; i < I; i++) {
QueueStateInfo.TaskStateInfo tsi = qsi.getTaskInfo().get(i);
String body = tsi.getBody();
System.out.println("body -> " + body);
Map<String, String> queryMap = getQueryMap(body);
@alejandrogr
alejandrogr / CloudStorageManager.java
Last active November 17, 2018 13:06
Send emails from Appengine with inline attachments through Mailgun
package com.alejandrogr.gists.mailgun;
import static com.alejandrogr.gists.mailgun.CloudStorageManager.JSON_FACTORY;
import static com.alejandrogr.gists.mailgun.CloudStorageManager.TRANSPORT;
import com.google.api.client.extensions.appengine.http.UrlFetchTransport;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.storage.Storage;
@alejandrogr
alejandrogr / Car.java
Last active November 17, 2018 13:07
Deal with list of Refs in objectify
package com.alejandrogr.gists.ofylistref;
import com.googlecode.objectify.Ref;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Ignore;
import com.googlecode.objectify.annotation.Load;
import com.googlecode.objectify.annotation.OnLoad;
import java.util.ArrayList;
import java.util.List;