Skip to content

Instantly share code, notes, and snippets.

View defHLT's full-sized avatar
🐔

Artem Kholodnyi defHLT

🐔
View GitHub Profile
-- destroyer sensor
local sensor_b = world:addBody(MOAIBox2DBody.STATIC)
sensor_f = sensor_b:addRect( STAGE_W/2, 0, -STAGE_W/2, 50)
sensor_b:setTransform( 0, -STAGE_H/2 - 60 )
sensor_f:setSensor(true)
sensor_f:setCollisionHandler(
function(event, fa, fb)
local body = fb:getBody()
local prop = body.prop
mainLayer:removeProp(prop)
# Sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set-window-option -g xterm-keys on
# Titles
set -g set-titles on
# Set window title string
# #H Hostname of local host
# #I Current window index
# #P Current pane index
----------------------------------------------------------------
-- Copyright (c) 2010-2011 Zipline Games, Inc.
-- All Rights Reserved.
-- http://getmoai.com
----------------------------------------------------------------
local function printf ( ... )
return io.stdout:write ( string.format ( ... ))
end
attribute vec2 uv;
varying vec4 colorVarying;
varying vec2 uvVarying;
varying vec2 texcoord;
void main () {
texcoord = uv;
gl_Position = gl_ModelViewProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
varying LOWP vec2 texcoord;
uniform sampler2D bgl_RenderedTexture;
float samples[11];
void main()
{
/*vec2 texcoord = gl_TexCoord[0].xy*/
@defHLT
defHLT / moai
Last active December 24, 2015 09:28
--------- beginning of /dev/log/system
I/WindowManager( 2878): Setting rotation to 1, animFlags=1
I/ActivityManager( 2878): Config changed: { scale=1.0 imsi=0/0 loc=en_GB touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=18 themeResource=null}
--------- beginning of /dev/log/main
E/ApplicationContext( 7416): Couldn't rename file /data/data/com.endomondo.android.pro/shared_prefs/com.endomondo.android.pro_preferences.xml to backup file /data/data/com.endomondo.android.pro/shared_prefs/com.endomondo.android.pro_preferences.xml.bak
E/ApplicationContext( 7416): Couldn't rename file /data/data/com.endomondo.android.pro/shared_prefs/com.endomondo.android.pro_preferences.xml to backup file /data/data/com.endomondo.android.pro/shared_prefs/com.endomondo.android.pro_preferences.xml.bak
E/ApplicationContext( 7416): Couldn't rename file /data/data/com.endomondo.android.pro/shared_prefs/com.endomondo.android.pro_preferences.xml to backup file /data/data/com.endomondo.android.pro/shared_prefs/com.endomondo.android
@defHLT
defHLT / gen_icons.sh
Last active December 23, 2015 01:38
#!/usr/bin/zsh
# e.g. -> ./gen_icons.sh ic_launcher.svg
#
PNGS=""
BASENAME=`basename $1 .svg`
mkdir -p drawable-{mdpi,hdpi,xhdpi,xxhdpi} google-play
inkscape -z -h 48 -w 48 -e drawable-mdpi/$BASENAME.png $1
inkscape -z -h 72 -w 72 -e drawable-hdpi/$BASENAME.png $1
inkscape -z -h 96 -w 96 -e drawable-xhdpi/$BASENAME.png $1
inkscape -z -h 144 -w 144 -e drawable-xxhdpi/$BASENAME.png $1
#!/usr/bin/ruby
# encoding: utf-8
# Created: 2013-04-19 17:51:52 +0300 by ice
# Generates beautiful bitcoin address
STDOUT.sync = true
%w{
openssl
benchmark
Aug 4 16:59:51 distantstar kernel: [61280.385755] Xorg: page allocation failure: order:5, mode:0x1040d0
Aug 4 16:59:51 distantstar kernel: [61280.385767] Pid: 1590, comm: Xorg Tainted: PF O 3.9.0-030900-generic #201304291257
Aug 4 16:59:51 distantstar kernel: [61280.385769] Call Trace:
Aug 4 16:59:51 distantstar kernel: [61280.385778] [<ffffffff8113bd56>] warn_alloc_failed+0xf6/0x150
Aug 4 16:59:51 distantstar kernel: [61280.385783] [<ffffffff816eec17>] ? __alloc_pages_direct_compact+0x1ad/0x1bf
Aug 4 16:59:51 distantstar kernel: [61280.385786] [<ffffffff8113faa0>] __alloc_pages_nodemask+0x860/0x990
Aug 4 16:59:51 distantstar kernel: [61280.385790] [<ffffffff8117c66a>] alloc_pages_current+0xba/0x170
Aug 4 16:59:51 distantstar kernel: [61280.385793] [<ffffffff8113ab5e>] __get_free_pages+0xe/0x40
Aug 4 16:59:51 distantstar kernel: [61280.385796] [<ffffffff8118653f>] kmalloc_order_trace+0x3f/0xd0
Aug 4 16:59:51 distantstar kernel: [61280.385901] [<ffffffffa01af8e2>] ? firegl_trace+0x72/
#!/usr/bin/ruby
output = `xrandr`
lvds = output[/LVDS connected.*mm/]
dfp1 = output[/DFP1 connected.*mm/]
if lvds && dfp1
status = "(both)"
options = "lvds\ndfp1"
elsif lvds
status = "(lvds)"