Skip to content

Instantly share code, notes, and snippets.

View andrew-aladev's full-sized avatar
🐻

Andrew Aladjev andrew-aladev

🐻
View GitHub Profile
@chuckremes
chuckremes / gist:5099307
Last active January 31, 2017 11:33
thread.backtrace is sometimes nil in jruby.
Exception in thread "JRubyWorker-57" java.lang.NullPointerException
at org.jruby.RubyThread.backtrace(RubyThread.java:973)
at rubyjit.Celluloid::StackDump$$snapshot_thread_47B21CF45C0FFCE0D8550EEBD839410A0BF60A1B424058530.__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/stack_dump.rb:53)
at rubyjit.Celluloid::StackDump$$snapshot_thread_47B21CF45C0FFCE0D8550EEBD839410A0BF60A1B424058530.__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/stack_dump.rb)
at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.IfNode.interpret(IfNode.java:118)
@andrew-aladev
andrew-aladev / index.html
Created November 27, 2012 20:44
proper twitter callback
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>
</head>
<body>
<script>
$(document).ready(function() {
var url = "https://twitter.com/intent/tweet?" + $.param({
@andrew-aladev
andrew-aladev / config.ru
Created November 22, 2012 12:17
twitter flickr share picture
require "./share"
run Share.new
@rolo
rolo / html_compile.py
Created August 1, 2012 16:37
Python script to compile .shtml files with server side includes down to flat HTML suitable for hosting on S3 or where SSIs aren't supported.
#! /usr/bin/env python
import os
import re
import shutil
from os.path import splitext
SOURCE = os.getcwd() + "/www/"
TARGET = os.getcwd() + "/compiled/"
if not os.path.exists(TARGET):
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn