Skip to content

Instantly share code, notes, and snippets.

View stokito's full-sized avatar
Self-hosting become easier

Sergey Ponomarev stokito

Self-hosting become easier
View GitHub Profile
@ssokolow
ssokolow / completer_entry.py
Created June 25, 2009 04:02
Modification of PyGTK's EntryCompletion example with shell-like tab completion.
#!/usr/bin/env python
"""Modification of PyGTK's EntryCompletion example with shell-like tab completion.
Tab works normally unless there's content, the cursor is at the end of it,
and nothing is selected, preserving intuitive tab-cycling behaviour in all
reasonable cases while still allowing comfortable tab completion.
(To tab-cycle into a field with content in it and then tab-complete, just press
End before you request completion)
If no completions are found, users may press Tab again to go to the next field.
@cdown
cdown / gist:1163649
Last active April 9, 2024 01:10
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
server.modules = (
...
"mod_webdav",
...
)
$HTTP["host"] =~ "weave.foo.com" {
server.document-root = "/foo/weave"
accesslog.filename = "/var/log/lighttpd/weave/access.log"
webdav.activate = "enable"
@bds
bds / gist:3733733
Created September 16, 2012 18:49
Ignore EOL characters in a git diff
git diff HEAD --ignore-space-at-eol
@guettli
guettli / gist:3884560
Created October 13, 2012 12:54 — forked from evoL/gist:1650115
Gtk Multi Autocomplete
import pygtk
pygtk.require("2.0")
import gobject
import gtk
from gtk import gdk
class EntryMultiCompletion(gtk.Entry):
def __init__(self):
gtk.Entry.__init__(self)
@atenni
atenni / README.md
Last active April 24, 2024 01:36
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@niquola
niquola / list.md
Last active May 20, 2018 04:52
Must Read from Ravil Bayramgalin (https://github.com/brainopia) + my small adds :)

Books

Concepts-Techniques-Models-Computer-Programming CMT это известная книжка CMT, за которой слава закрепилась не хуже чем у SICP

это из этой книжки классификация различных парадигм Если присмотришься, то увидишь, что Oz поддерживает большинство вариаций (с этой целью его и конструировали, чтобы можно было наглядно продемонстрировать различные подходы в одном языке)

@Dierk
Dierk / ModularGroovyTraits
Created April 6, 2014 19:23
Using modular traits in Groovy 2.3.0-beta-1
trait HasId {
long id
}
trait HasVersion {
long version
}
trait Persistent {
boolean save() { println "saving ${this.dump()}" }
}
trait Entity implements Persistent, HasId, HasVersion {
@jppommet
jppommet / bcm4352-wifi-ac.md
Created July 4, 2014 20:03
Linux Ubuntu Drivers for Broadcom Chipset BCM4352 802.11ac Wireless Network Adapter [14e4:43b1]
@artyom
artyom / result.txt
Created July 10, 2014 14:39
Golang XOR performance for 8/64 bytes long integers
$ go test -bench .
PASS
Benchmark8 1000000 1093 ns/op 936.69 MB/s
Benchmark64 20000000 134 ns/op 7603.74 MB/s
ok _/private/tmp/x 3.944s