Skip to content

Instantly share code, notes, and snippets.

View oogali's full-sized avatar

Omachonu Ogali oogali

  • Ordinary Stack
  • Princeton, NJ
  • 21:20 (UTC -04:00)
View GitHub Profile
@Rich-Harris
Rich-Harris / service-workers.md
Last active June 6, 2024 22:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@debedb
debedb / WrappedStreamingBody
Last active November 26, 2020 09:05
Wrap boto3's StreamingBody object to provide enough Python fileobj functionality fileobj functionality so that GzipFile is satisfied.
class WrappedStreamingBody:
"""
Wrap boto3's StreamingBody object to provide enough
fileobj functionality so that GzipFile is
satisfied. Sometimes duck typing is awesome.
@jorgemorgado
jorgemorgado / LICENSE.md
Last active December 8, 2022 08:54
Sparkline chart widget for Dashing

The MIT License (MIT)

Copyright (c) 2015 Jorge Morgado

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@rochacbruno
rochacbruno / Makefile
Last active June 22, 2022 23:35
Python Setup Tips and Tricks http://j.mp/setup_py
.PHONY: test install pep8 release clean
test: pep8
py.test --cov -l --tb=short --maxfail=1 program/
install:
python setup.py develop
pep8:
@flake8 program --ignore=F403 --exclude=junk
@revskill10
revskill10 / shards.yml
Created November 26, 2015 09:12 — forked from eprothro/shards.yml
Dynamic Octopus configuration for master/slave horizontal DB scaling with a Rails application on the Heroku stack. See the wiki page for more info: https://github.com/tchandy/octopus/wiki/Replication-with-Rails-on-Heroku. Props to Heroku for the idea, gleaned from the dynamic database.yml they inject at build-time for rails apps.
<%
require 'cgi'
require 'uri'
def attribute(name, value, force_string = false)
if value
value_string =
if force_string
'"' + value + '"'
else
@peelman
peelman / DashingUnifiVideo.md
Last active January 20, 2016 11:50 — forked from tracstarr/DashingUnifiVideo.md
Dashing UnifiVideo Widget

Dashing.io Widget for UnifiVideo NVR

This method uses API Key access so I suggest you setup a guest account with API access but limited (Visible and View Feed) access. Then login as the guest user, enable API access, and generate a new key. Copy the key for use.

Switch to the Devices tab and open the Configure dialog for the cam. On the Details tab, right-click the thumbnail view and Copy the image URL to the clipboard. It will look similar to the following if pasted to an address bar or text editor: http://192.168.1.105:7443//api/2.0/snapshot/camera/05a2bc63-d1ce-399f-8327-3a19b0cd3e8f?width=%d&force=true

The guid after /camera/ is what you want to use in the unifivideo.rb file.

You can setup as many cameras as you want, just add a name and UUID for each to the secrets/unifi.yml file.

@Hainish
Hainish / webshims_asset_compile.rake
Created May 4, 2015 20:58
Create symlinks for non-digest webshim assets in /public/
# Rails4 doesn't create un-fingerprinted assets anymore, but we
# need a couple for webshims inclusion. Let's try to hook in and make
# symlinks.
# Lifted from team-umlaut/umlaut
require 'pathname'
# Every time assets:precompile is called, trigger webshims:create_non_digest_assets afterwards.

How I switched from mdadm to btrfs

After reading [this Ars Technica article][1], I decided that I wanted to start using btrfs on my home fileserver. It had been running for a few years with an mdadm raid-10 array, formatted with ext4, holding about 3.4 TB of data. I figured I would take advantage of some of the special capabilities of btrfs to perform the conversion in place. After some research, I formed my basic plan.

  • backup data to external drives
  • remove two of the drives from the mdadm raid-10
  • configure those two drive with a btrfs raid-0 filesystem
  • copy the data from the degraded mdadm raid-10 to the new btrfs raid-0
  • completely deactivate the mdadm raid-10
@genadyo
genadyo / gist:295a5e8f0d743f57137f
Created November 27, 2014 17:21
app_store_app_data.json
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",
@seyhunak
seyhunak / sidekiq.conf
Last active January 18, 2020 02:02
Sidekiq - Supervisord Configuration
/etc/supervisor/conf.d/sidekiq.conf
[program:sidekiq]
command=/usr/local/bin/sidekiq.sh
directory=/usr/local/bin/
user=ubuntu
startsecs=10
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/sidekiq.log