Skip to content

Instantly share code, notes, and snippets.

View defHLT's full-sized avatar
🐔

Artem Kholodnyi defHLT

🐔
View GitHub Profile
-> ice ~ % adb shell input
Usage: input [<source>] <command> [<arg>...]
The sources are:
mouse
keyboard
joystick
touchnavigation
touchpad
trackball
#!/bin/bash
# Send power button press if screen is off
(adb shell dumpsys power | grep -q "Display Power: state=OFF" ) && adb shell input keyevent KEYCODE_POWER
# Send menu key press to unlock
adb shell input keyevent 82
# Even if failed let the gradle build continue
true
#!/usr/bin/clojure
; Created: Fri Jan 9 16:10:56 EET 2015
; encoding: utf-8
(defn burrows-wheeler [s]
(let [size (count s)]
(->>
(repeat 2 s)
(apply str)
#!/usr/bin/clojure
; Created: Fri Jan 9 16:10:56 EET 2015
; encoding: utf-8
(defn burrows-wheeler [s]
(let [size (count s)]
(->>
(repeat size s)
(apply str)
(ns com.mlatu.clojure.test.main
(:use [neko.activity :only [defactivity set-content-view! *a]]
[neko.threading :only [on-ui]]
[neko.notify]
[neko.resource]))
(fire (*a) :notification
(notification :icon (get-resource (*a) :drawable :ic-launcher)
:ticker-text "You've got mail"
<html>
<head>
<title>My first Three.js app</title>
<style> body { margin: 0; } canvas { width: 100%; height: 100% } </style>
<script src="js/three.min.js"></script>
<script src="js/TrackballControls.js"></script>
</head>
<body>
<script>
@defHLT
defHLT / tree.pde
Last active August 29, 2015 14:06
int W = 1024;
int H = 700;
float K1 = 0.4;
float K2 = 0.6;
float LEN_DEC1 = 0.66;
float LEN_DEC2 = 0.5;
float ANGLE1 = PI/6;
float ANGLE2 = -PI/6;
int STEPS = 14;
@defHLT
defHLT / raw-resource-to-string.java
Last active August 29, 2015 14:06
read Android raw resource file to Java string
private String getRawResource(int resource) {
String res = null;
InputStream is = getContext().getResources().openRawResource(resource);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] b = new byte[1];
try {
while ( is.read(b) != -1 ) {
baos.write(b);
};
res = baos.toString();
// Insert current date in Google Spreadsheet
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or FormApp or SpreadsheetApp.
ui.createMenu('Custom Menu')
.addItem('Insert Date', 'insertDate')
.addToUi();
}
----------------------------------------------------------------
-- Copyright (c) 2010-2011 Zipline Games, Inc.
-- All Rights Reserved.
-- http://getmoai.com
----------------------------------------------------------------
MOAISim.openWindow ( "test", 320, 480 )
viewport = MOAIViewport.new ()
viewport:setSize ( 320, 480 )