Skip to content

Instantly share code, notes, and snippets.

View macbre's full-sized avatar
🏠
Working from home

Maciej Brencz macbre

🏠
Working from home
View GitHub Profile
@karmi
karmi / tophashes-sliding-window-redis.sh
Created December 7, 2010 10:06
Desigining "trending topics in 24 hours sliding window" with Redis
# ------------------------------------------------------------------
# Desigining "trending topics in 24 hours sliding window" with Redis
# ------------------------------------------------------------------
redis-cli del tophashes:2010-12-07-08-00
redis-cli del tophashes:2010-12-07-09-00
redis-cli del tophashes:current
echo '=== 8:00 AM ==='
@digitalresistor
digitalresistor / README.md
Created February 11, 2012 04:18
Generates various mpeg4 files from a gource run ...

Collection of Gource Helper Scripts

This collection of helper scripts are used to generate .mp4 files containing the output from [gource][1], a visualisation tool that generates pretty output from the git log output.

Requirements

  1. gource
  2. ffmpeg with x264 support
@cmalven
cmalven / index.html
Last active April 27, 2024 10:17
Shortest (useful) HTML5 Document
<!-- http://www.brucelawson.co.uk/2010/a-minimal-html5-document/ -->
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>blah</title>
</head>
<body>
<p>I'm the content</p>
@miracle2k
miracle2k / odict.py
Created July 26, 2012 20:56
Make PyYAML do very basic things.
"""Make PyYAML output an OrderedDict.
It will do so fine if you use yaml.dump(), but that generates ugly,
non-standard YAML code.
To use yaml.safe_dump(), you need the following.
"""
def represent_odict(dump, tag, mapping, flow_style=None):
"""Like BaseRepresenter.represent_mapping, but does not issue the sort().
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@willurd
willurd / web-servers.md
Last active June 7, 2024 03:53
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@andrequeiroz
andrequeiroz / holtwinters.py
Last active July 5, 2023 07:50
Implementation of Holt-Winters algorithms in Python 2
#The MIT License (MIT)
#
#Copyright (c) 2015 Andre Queiroz
#
#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:
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@SpOOnman
SpOOnman / graphite-local-install.sh
Created July 9, 2013 14:02
How to install Graphite as a user on CentOS 5.5
#!/bin/bash
# How to install Graphite as a user on CentOS 5.5 (with neither internet access and root account)
# --------------------------------------------------------------------------------
# Tomasz Kalkosiński - refaktor.blogspot.com
#
# Graphite is a Scalable Realtime Graphing (http://graphite.wikidot.com/)
# This script is based on two excellent tutorials:
# http://community.webfaction.com/questions/10038/how-to-install-pycairo-in-python27-thanks
@matt448
matt448 / slack_nagios.sh
Last active February 13, 2023 15:38
Script to post Nagios notifications into a Slack channel
#!/bin/bash
# This script is used by Nagios to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Nagios configuration.
#
# All variables that start with NAGIOS_ are provided by Nagios as
# environment variables when an notification is generated.
# A list of the env variables is available here: