Skip to content

Instantly share code, notes, and snippets.

View rosshadden's full-sized avatar

Ross Hadden rosshadden

View GitHub Profile
@iangilman
iangilman / MyLWPService.java
Last active August 10, 2023 18:36
Android WallpaperService with WebView
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Point;
import android.preference.PreferenceManager;
import android.service.wallpaper.WallpaperService;
import android.content.Context;
import android.support.v4.content.LocalBroadcastManager;
The below code is not valid C code - a preprocessor must be used:
```
CHAKRA_API
JsParseModuleSource(
_In_ JsModuleRecord requestModule,
_In_ JsSourceContext sourceContext,
_In_ BYTE* script,
_In_ unsigned int scriptLength,
_In_ JsParseModuleSourceFlags sourceFlag,
@bloodyowl
bloodyowl / gist:41b1de3388c626796eca
Last active April 20, 2020 03:27
es6 event-emitter
var DEFAULT_MAX_LISTENERS = 12
function error(message, ...args){
console.error.apply(console, [message].concat(args))
console.trace()
}
class EventEmitter {
constructor(){
this._maxListeners = DEFAULT_MAX_LISTENERS
@zer4tul
zer4tul / weechat.md
Last active August 21, 2021 21:12
A Simple, Base16 Friendly, Weechat Setup

A Simple, Base16 Friendly, Weechat Setup

Scripts

  • Some must-have scripts
  /script install buffers.pl buffer_autoclose.py iset.pl go.py colorize_nicks.py
@optikalefx
optikalefx / main.html
Last active December 26, 2015 06:49
Micro Single Mobile App Framework
<div class="pages">
<div data-page="home" class="page current">
<h1>Home</h1>
<button data-to="key-service-offerings">Go to key services</button>
<button data-to="industries-served">industries-served</button>
<button data-to="technology-solutions">technology-solutions</button>
<button data-to="home">home</button>
</div>
<div data-page="key-service-offerings" class="page right">
<h1>Key service</h1>
// From Ben Alman:
Array.apply(null, {length: 5}).map(Function.prototype.call, Number);
// ...Which is way cooler then my original:
Array.apply(null, new Array(5)).map(function(v, k) { return k; });