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
@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

@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):
@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({
@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
@davispuh
davispuh / steam_console_params.txt
Last active November 18, 2024 02:25
Steam client parameters, consoles commands and variables
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accesscode -
-all_languages - show longest loc string from any language
-batterytestmode - rapidly cycle battery percentages for testing
-bigpicture - Start in Steam Big Picture mode
-blefw -
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
#!/bin/sh
### BEGIN INIT INFO
# Provides: dockercompose
# Required-Start: $docker
# Required-Stop: $docker
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Docker Services
### END INIT INFO
@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