Skip to content

Instantly share code, notes, and snippets.

View osiloke's full-sized avatar
🎯
Focusing

Osi Emoekpere osiloke

🎯
Focusing
View GitHub Profile
@osiloke
osiloke / designer.html
Last active August 29, 2015 14:13
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
@osiloke
osiloke / gist:d6e36e099579ed144a3c
Created January 26, 2015 23:30
Golang backports by tsuru team - Useful for ubuntu 12.04 openvz containers
https://launchpad.net/~tsuru/+archive/ubuntu/golang
sudo add-apt-repository -y ppa:tsuru/golang
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import com.progwebtech.android.foodisready.model.BackDrop;
import com.progwebtech.android.foodisready.model.Canteen;
@osiloke
osiloke / mapper.go
Created May 12, 2015 17:02
JsonSchema to bleve mapping
func addSchemaMapper(schema *Schema) {
ix := schema.GetIndexer()
if ix == nil {
println("Schema does not have an indexer")
return
}
unindexedFieldMapping := bleve.NewTextFieldMapping()
unindexedFieldMapping.Index = false
unindexedFieldMapping.Store = false
from collections import deque
import json
from kivy import Logger
import threading
from kivy.clock import Clock
from kivy.network.urlrequest import UrlRequest
from kivy.support import install_twisted_reactor
# from memory_profiler import profile
import zmq
from kivy.compat import queue
@osiloke
osiloke / extractors.py
Created August 12, 2011 14:27 — forked from davepeck/extractors.py
A scrapy link extractor that uses BeautifulSoup
import re
from scrapy.link import Link
from urlparse import urljoin
from BeautifulSoup import BeautifulSoup
class SoupLinkExtractor(object):
def __init__(self, *args, **kwargs):
super(SoupLinkExtractor, self).__init__()
allow_re = kwargs.get('allow', None)
@osiloke
osiloke / transfer-network-config
Created September 30, 2011 15:18 — forked from makuk66/transfer-network-config
Notes about using point-to-point links for routing IP addresses in virtual machines
Some experiments, which worked but were eventually not used.
See http://www.greenhills.co.uk/2011/06/10/lxc.html
Now, the next big milestone is to get networking working.
In the config, we told lxc-create to use br0 as the link,
and inside the container we have eth0:
root@thunder:/# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.962e6bb72480 no vethP70LNx
@osiloke
osiloke / lxc.rb
Created October 3, 2011 20:23 — forked from niklas/lxc.rb
Setup an lxc-container (chef recipe)
package 'debootstrap'
package 'apt-cacher-ng'
package 'inotify-tools'
include_recipe 'lxc::manage'
include_recipe 'lxc::network_bridge'
include_recipe 'lxc::dns'
host = node[:container]
@osiloke
osiloke / native.scroll.html
Created October 22, 2012 17:25 — forked from mattsahr/native.scroll.html
IOS Webkit - native internal scroll - a fix for the document page-top-bounce
<!DOCTYPE html>
<html>
<!-- NOTES
Demo - uses IOS native scroll available in IOS5, but sidestep the document-bounce behavior. Tested on iPad 1, using IOS 5.1.
This approach uses a set of 3 nested divs.
OuterDiv -- fixed height, width, overflow-scrolling: touch;
MiddleDiv -- fixed height width, overflow-scrolling: touch; fits inside OuterDiv
InnerDiv -- fixed height width, bigger than MiddleDiv, so it kicks in the overflow behavior
@osiloke
osiloke / coordinated.xml
Created December 4, 2015 14:51
coordinated recycleview
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
style="@style/myRecyclerViewStyle"/>