Skip to content

Instantly share code, notes, and snippets.

Tom von Schwerdtner tvon

Block or report user

Report or block tvon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View aws-bootstrap.rb
require 'aws'
require 'json'
# Set the following environment variables:
#
# PROJECT_NAME=""
# AWS_ACCESS_KEY_ID=""
# AWS_SECRET_ACCESS_KEY=""
#
# If so desired:
View git-html2haml.sh
#!/bin/bash
html2haml -ex $1 > tmp.haml
git mv $1 ${1/.erb/.haml}
mv tmp.haml ${1/.erb/.haml}
View simple-object-store.js
function SimpleObjectStore(storeName){
this.storeName = storeName;
this.changedEvent = "asq:" + this.storeName + "-changed";
}
SimpleObjectStore.prototype = {
constructor: SimpleObjectStore,
count: function(){
return this.get().length;
View env.rb
Capybara.register_driver :poltergeist_inspector do |app|
Capybara::Poltergeist::Driver.new(app, :inspector => true)
end
Before('@javascript', '@inspector') do
Capybara.javascript_driver = :poltergeist_inspector
end
View rubocop-it.sh
#!/bin/bash
bundle exec rubocop --format clang --only $1 -a
git commit -p -m "$1"
@tvon
tvon / SSLPoke.java
Last active Aug 29, 2015
JRuby/Java SSL issue
View SSLPoke.java
# from: https://gist.github.com/4ndrej/4547029
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
View gist:7e7d98c19597e6f37ef0
### Keybase proof
I hereby claim:
* I am tvon on github.
* I am tvon (https://keybase.io/tvon) on keybase.
* I have a public key whose fingerprint is 4FFD D907 7261 DB2E 0E7D DC66 8C40 C6BE D305 148A
To claim this, I am signing this object:
@tvon
tvon / ubiquity-todoist.js
Created Feb 6, 2009
Todoist plugin for Ubiquity
View ubiquity-todoist.js
TODOIST_DUE = "";
TODOIST_PRIORITY = 4;
Todoist = {
setToken:function(key){
if (!Application.prefs.has("todoist_token")) {
Application.prefs.setValue("todoist_token", key);
} else {
var new_key = Application.prefs.get("todoist_token");
new_key.value = key;
View gig.py
#!/usr/bin/env python
"""
This script aims at providing a simple way to bootstrap a self-contained django project.
In short, it makes a few trivial decisions for you.
To those who use the Django framework this may seem a bit unecessary, but I believe that
it could be easier to get started with django, without having to impose minor decisions
on new users such as where to place templates and basic media files.
@tvon
tvon / admin.py
Created Apr 16, 2009
Customizing User list view and edit form in Django
View admin.py
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from forms import UserChangeForm
class UserAdmin(BaseUserAdmin):
list_display = ('username', 'last_name', 'first_name', 'is_superuser', 'is_staff')
You can’t perform that action at this time.