Skip to content

Instantly share code, notes, and snippets.

View andrew-aladev's full-sized avatar
🐻

Andrew Aladjev andrew-aladev

🐻
View GitHub Profile
#!/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
@andrew-aladev
andrew-aladev / config.ru
Created November 22, 2012 12:17
twitter flickr share picture
require "./share"
run Share.new
@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 / jxcore install script
Last active September 1, 2016 10:54 — forked from mohlsen/jxcore install script
jx-install.sh
#!/bin/bash
# based on https://github.com/jxcore/jxcore/blob/master/tools/jx_install.sh
# changed because jxcore.com was down and the aws instance no longer exists
NORMAL_COLOR='\033[0m'
RED_COLOR='\033[0;31m'
GREEN_COLOR='\033[0;32m'
GRAY_COLOR='\033[0;37m'
MAGENTA_COLOR='\033[0;35m'
@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)
@ugorji
ugorji / msgpack-timestamp-type.md
Last active March 5, 2018 20:51
MsgPack: Support timestamp as new spec-defined inter-operable extension type

Timestamp is a data type that represents an instant in time and space. It is supported by most programming languages. However, it is not defined in the msgpack spec. The lack of built-in support for timestamp is a constant issue brought up while evaluating encodings.

The proposal is to include timestamp support in the new spec as an inter-operable extension type, defined by the spec along with Binary. It will have extension tag -2.

A timestamp is composed of 3 components:

  • secs: signed integer representing seconds since unix epoch
  • nsces: unsigned integer representing fractional seconds as a nanosecond offset within secs, in the range 0 <= nsecs < 1e9
  • tz: signed integer representing timezone offset in minutes east of UTC, and a dst (daylight savings time) flag
@philipz
philipz / gist:590a241cd262fac09152
Last active September 3, 2019 22:29
Qemu-arm-static on X86 error
Qemu 版本
qemu-arm-static -version
qemu-arm version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.10), Copyright (c) 2003-2008 Fabrice Bellard
### 透過 Qemu-arm-static 執行 RPi GO
philipz@philipz:~$ docker run -it -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static philipz/rpi-golang bash
root@c306591a15f6:/gopath# go
fatal error: rt_sigaction failure
@henriquemenezes
henriquemenezes / ip-default-gw.rb
Created April 1, 2016 14:32
Get default gateway IP in Ruby
gw = `ip route show`[/default.*/][/\d+\.\d+\.\d+\.\d+/]
@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):
@jk0
jk0 / gist:2d263a1bac50b0cd1e71
Created May 1, 2015 15:47
TCP/IP Over AX.25
Equipment
Raspberry Pi - http://amzn.com/B00MV6TAJI
USB Bluetooth Adapter - http://amzn.com/B009ZIILLI
2x BaoFeng UV5R Radio - http://amzn.com/B007H4VT7A
2x Nagoya NA-771 Antenna - http://amzn.com/B00KC4PWQQ
2x Mobilinkd TNC2 - http://store.mobilinkd.com/products/battery-powered-bluetooth-kiss-tnc
2x Mobilinkd TNC2 Cable - http://store.mobilinkd.com/products/kenwood-wouxun-baofeng-tnc-cable
Documentation