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
@bds
bds / gist:3733733
Created September 16, 2012 18:49
Ignore EOL characters in a git diff
git diff HEAD --ignore-space-at-eol
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"
@und3f
und3f / deny-unknown-host
Created December 12, 2011 15:46
Nginx configuration to deny unknown hosts
server {
listen 80 default_server;
return 444;
}
@cdown
cdown / gist:1163649
Last active April 14, 2025 22:42
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
@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.