Skip to content

Instantly share code, notes, and snippets.

View attilaolah's full-sized avatar
🌿
Namespacing.

Attila Oláh attilaolah

🌿
Namespacing.
View GitHub Profile
@attilaolah
attilaolah / p38n31.go
Created March 12, 2014 07:53
Naive take on this math problem: http://math.stackexchange.com/q/597234
package main
import (
"math/big"
"fmt"
)
type powersOf struct {
E int64
b, n *big.Int
@attilaolah
attilaolah / pixel.go
Created December 15, 2014 15:44
Serve a 1-pixel PNG in Go
// Package pixel serves a one pixel image.
package pixel
import (
"encoding/base64"
"net/http"
)
const px = `iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=`
@attilaolah
attilaolah / index.sh
Created March 3, 2015 19:29
Radio Index
#!/usr/bin/env sh
rtmpdump -v -r "rtmp://37.187.153.186:1935/asmedia/index" -o- \
| cvlc \
--extraintf http \
--http-password changeme \
-
@attilaolah
attilaolah / sharenet.sh
Created March 3, 2015 22:21
Internet Sharing
#!/usr/bin/env sh
#
# Internet Sharing
#
# Based on: https://wiki.archlinux.org/index.php/Internet_sharing
#
LAN=enp0s0
WAN=wlp0s0
@attilaolah
attilaolah / aiur-doo-legal-info
Last active October 2, 2015 13:38
Aiur d.o.o. legal information
@attilaolah
attilaolah / ext-define.coffee
Last active October 8, 2015 00:48
HTTP DELETE fix for Sencha Touch 2.1
Ext.define "MyApp.data.Connection",
override: "Ext.data.Connection"
setOptions: ->
options = @callParent arguments
if options.method is "DELETE"
options.data = null
options
@attilaolah
attilaolah / campervan
Last active December 10, 2015 13:58
CamperVan & irssi wrapper script
#! /usr/bin/env sh
RUBY_VERSION="1.9.1"
SERVER="${HOME}/.gem/ruby/${RUBY_VERSION}/bin/camper_van"
PIDFILE="/tmp/camper_van.pid"
if [ ! -e ${SERVER} ]; then
echo "CamperVan server not found at '${SERVER}'."
fi
@attilaolah
attilaolah / byobu-5.25.ebuild
Last active December 10, 2015 22:39
Ebuild for Byobu version 5.25
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
PYTHON_DEPEND="2"
inherit python
DESCRIPTION="A set of profiles for the GNU Screen console window manager (app-misc/screen)"
HOMEPAGE="https://launchpad.net/byobu"
import re
class WordFinder(object):
"""Searches text for words that conform to the given constraint.
To use it, instantiate it with any number of strings. These strings will be
used as constraints. For example, to find all words that contain the letter
'X' and the number '6', you can do something like this::
https://bugs.gentoo.org/show_bug.cgi?id=367425
diff -ruN fontforge-20110222~/fontforge/parsepdf.c fontforge-20110222/fontforge/parsepdf.c
--- fontforge-20110222~/fontforge/parsepdf.c 2011-02-15 05:37:39.000000000 +0200
+++ fontforge-20110222/fontforge/parsepdf.c 2011-05-17 22:19:56.000000000 +0300
@@ -759,7 +759,11 @@
if ( zlib!=NULL )
return( true );
- if ( (zlib = dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY))==NULL ) {