Skip to content

Instantly share code, notes, and snippets.

@manuq
manuq / eos-daily-report.py
Created February 3, 2021 16:27
Send daily report to Slack.
#!/usr/bin/env python3
"""
Usage
-----
Change the channel ID, specify the slackUserToken environment
variable, then pipe the report through this script.
#!/bin/bash
# bash multi flock
#
# allow 3 instances of a bash function running at the same time
run_instance() {
(
flock -n 99 || return 1
echo "starting instance $@..."
###############################################################################
#
# Bash helper functions for logging.
#
# Inspired in Python logging. Ready to source it in your bash script.
# It can redirect all the output to a file and also redirect all the
# trace to another file, which is useful for debugging.
#
# Usage: see how to use it in the test at the bottom.
#
#!/usr/bin/ruby
# Utility for Puppet that outputs orphaned resources. Orphaned are
# resources that where at one point managed by Puppet, but they no
# longer are.
#
# We need to require Puppet because deserializing the report produces
# Puppet objects.
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js canvas - geometry - cube</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
font-family: Monospace;
background-color: #f0f0f0;
from math import sin, cos
from random import random
size(900,200)
speed(30)
def setup():
global cnt
cnt = 0.0
diff --git a/test/karma.conf.js b/test/karma.conf.js
index c1004d6..0eb253c 100644
--- a/test/karma.conf.js
+++ b/test/karma.conf.js
@@ -47,7 +47,7 @@ logLevel = LOG_INFO;
// enable / disable watching file and executing tests whenever any file changes
-autoWatch = true;
+autoWatch = false;
@manuq
manuq / gist:5592235
Created May 16, 2013 14:44
Custom scrollable widget for a Gtk DrawingArea
import cairo
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GObject
import sys
def _surface_from_file(file_location, ctx):
@manuq
manuq / treemodel_test.py
Created April 27, 2012 13:30
treemodel test
# test GTK3+ GtkTreeModel in PyGI
from gi.repository import Gtk
store = Gtk.ListStore(str, str)
view = Gtk.TreeView()
view.set_model(store)