Skip to content

Instantly share code, notes, and snippets.

@saik0
saik0 / MyContentProvider.java
Created November 15, 2012 15:14
Sample ContentProvider that performs all operations transactionally and notifies once in batch operations.
public class MyContentProvider extends ContentProvider {
private final ThreadLocal<Boolean> mApplyingBatch;
private final ThreadLocal<Set<Uri>> mChangedUris;
private boolean applyingBatch() {
return mApplyingBatch.get() != null && mApplyingBatch.get();
}
private Uri insert(final Uri uri, final ContentValues values, final SQLiteDatabase db) {
// do the uri matching and insert
@saik0
saik0 / gol.rs
Last active January 25, 2017 22:39
fn on_render(&mut self, window: &mut PistonWindow, ren: RenderArgs, e: Event) {
let fps = self.fps_counter.tick();
let ref front = self.front;
window.draw_2d(&e, |c, g| {
let rect = Rectangle::new(color::BLACK);
clear(color::WHITE, g);
let mut i = 0;
let mut bounds = [0.0, 0.0, SIZE, SIZE];
@saik0
saik0 / 90-uinput.rules
Last active April 8, 2016 23:00
xboxdrv: Xbox 360 Wireless Receiver with up to four gamepads
# Set the ownership and permissions for the uinput device
KERNEL=="uinput", OWNER="root", GROUP="uinput", MODE="0660"
if (get_application_name()=="Starbound - Beta") then
set_window_position2(0,0);
maximize();
undecorate_window();
end
@saik0
saik0 / PKGBUILD
Created September 19, 2013 14:22
Boson X PKGBUILD
# Maintainer: Ben R <thebenj88 *AT* gmail *DOT* com>
pkgname=boson-x
pkgver=1.0.1
_pkgver=${pkgver//\./_} # replace all '.' with '_'
pkgrel=3
pkgdesc="DRM-free rotational running game"
arch=('x86_64')
url="http://www.boson-x.com/"
license=('Custom')
source=("http://downloads.muandheyo.com/BosonX_v${_pkgver}_Linux.zip"
@saik0
saik0 / index.html
Created April 3, 2013 02:47
leaflet test
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.ie.css" />
<![endif]-->
<script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<script type="text/javascript" src="leafletembed.js"></script>
</head>
<body onload="initmap();">
@saik0
saik0 / DemoUnifiedPreferenceActivity.java
Created November 14, 2012 18:23
How to find preferences and setup listeners in UnifiedPreference
/*
** Copyright 2012, Joel Pedraza
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
@saik0
saik0 / PKGBUILD
Created November 13, 2012 21:46
eclipse-android 21.0.0-1
# Maintainer: Jakub Schmidtke <sjakub-at-gmail-dot-com>
# Contributor: Joel Pedraza <joel@joelpedraza.com>
# Contributor: Forrest L <cybercyst at gmail com>
# Contributor: Michael P <ptchinster@archlinux.us>
# Contributor: Marcin "eXine" M. <exine@jun.pl>
# Contributor: Artyom Smirnov <smirnoffjr@gmail.com>
# Contributor: Ashok `ScriptDevil` Gautham <ScriptDevil@gmail.com>
# Contributor: Laszlo Papp <djszapi2 at gmail com>
# Contributor: Antonio Santos <asantos at gmail dot com>
@saik0
saik0 / PKGBUILD
Created November 13, 2012 21:14
android-support r11-1
# Maintainer: Jakub Schmidtke <sjakub-at-gmail-dot-com>
# Contributor: Joel Pedraza <joel@joelpedraza.com>
pkgname=android-support
pkgver=r11
pkgrel=1
pkgdesc='Android Support Package'
arch=('any')
url="https://developer.android.com/sdk/compatibility-library.html"
license=('custom')
@saik0
saik0 / keybase.md
Created July 24, 2015 02:34
Keybase Proof

Keybase proof

I hereby claim:

  • I am saik0 on github.
  • I am joelpedraza (https://keybase.io/joelpedraza) on keybase.
  • I have a public key whose fingerprint is 46E4 E501 0F1A 56F4 8235 9512 A092 F38E A440 C589

To claim this, I am signing this object: