Skip to content

Instantly share code, notes, and snippets.

View starkers's full-sized avatar

David Stark starkers

  • London, UK
  • 09:24 (UTC +01:00)
View GitHub Profile
@Zearin
Zearin / python_decorator_guide.md
Last active July 24, 2024 03:06
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@olivere
olivere / bulk_processor_example1.go
Created January 16, 2016 11:17
Example #1 of bulk processor usage
// This is an example of using elastic's BulkProcessor with Elasticsearch.
//
// See https://github.com/olivere/elastic and
// and https://github.com/olivere/elastic/wiki/BulkProcessor
// for more details.
/*
* This example illustrates a simple process that performs bulk processing
* with Elasticsearch using the BulkProcessor in elastic.
*
@oholiab
oholiab / gist:52e913caa0a6ea12695518e764a16bd0
Created August 7, 2016 19:05
half assed attempt at IRC on the EMF TiLDA 3
import wifi
import socket
import ure
import ubinascii
import pyb
import uhashlib
uid = str(ubinascii.hexlify(uhashlib.sha256(pyb.unique_id()).digest()), 'ascii')
HOST="irc.freenode.net"
PORT=6667
@BenoitAverty
BenoitAverty / userChrome.css
Last active July 22, 2023 13:32
Hide tab bar on firefox 89 when there is only one tab
/*
How To:
1. Find your firefox profile folder : https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data
2. create a "chrome" folder if it doesn't exist
3. Paste content of this gist in a "userChrome.css" file
4. Go to about:config and set toolkit.legacyUserProfileCustomizations.stylesheets to true
5. set browser.tabs.tabmanager.enabled to false (to hide the "tab search" button)
5. Restart Firefox
Don't hesitate to say if there are bugs, I only tested this for my workflow : I don't use tabs