Skip to content

Instantly share code, notes, and snippets.

@AdamNaj
AdamNaj / about.md
Last active July 13, 2022 19:50
Z Wave Graph for Home Assistant
@peterfarrell
peterfarrell / install_latest_vagrant_via_ansible
Last active February 5, 2017 16:06
Install latest Vagrant with Ansible (x86_64)
- name: Compute Vagrant latest version
sudo: yes
shell: wget -qO - https://dl.bintray.com/mitchellh/vagrant/|sed -n 's/.*href=\"\([^"]*\).*/\1/p'|grep x86_64\.deb|tail -1|cut -d'#' -f2
register: vagrant_file_name
- name: Download Vagrant latest version
shell: "wget https://dl.bintray.com/mitchellh/vagrant/{{ vagrant_file_name.stdout }} -O {{ vagrant_file_name.stdout }}"
args:
chdir: "./bootstrap/files"
creates: "{{ vagrant_file_name.stdout }}"
#!/bin/bash
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
gstreamer1.0-libav
epiphany-browser
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@zlalanne
zlalanne / indent.py
Created June 4, 2013 23:29
Indents XML node in python
def indent(elem, level=0):
"""Add whitespace to xml document to increase readability
elem - root element to start the indention at
level - start level of indention
"""
i = "\n" + level*" "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + " "
@OpenNingia
OpenNingia / terminal_color_scheme
Last active July 27, 2017 09:01
Simple script to apply Solarized color scheme to Pantheon Terminal
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Solarized theme for pantheon-terminal
see http://ethanschoonover.com/solarized
"""
import posixpath
import sys
from gi.repository import Gio
@zlalanne
zlalanne / PDFMerge.py
Last active October 26, 2020 03:21
Python script to merge a folder of pdfs, can define order in list.txt contained within the directory
#!/usr/bin/env python
"""
Simple Python script that combines a folder of pdfs into a single
pdf. By default the pdfs are merged in alphabetical order and
only appear once. To change this create a "list.txt" file in the
directory with the pdfs to merge and list the order of the pdfs
to merge.
Ex list.txt:
doc2.pdf
@brianly
brianly / Solarized Dark.xml
Created January 16, 2012 18:47
Solarized Dark for PyCharm (Brian's edits of https://github.com/jkaving/intellij-colors-solarized)
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Solarized Dark" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="14" />
<option name="EDITOR_FONT_NAME" value="Consolas" />
<colors>
<option name="ADDED_LINES_COLOR" value="" />
<option name="ANNOTATIONS_COLOR" value="2b36" />
<option name="ANNOTATIONS_MERGED_COLOR" value="" />
<option name="CARET_COLOR" value="dc322f" />
@sramana
sramana / graph_coloring.py
Created September 17, 2010 04:09
Python Program for Graph Coloring Problem
colors = ['Red', 'Blue', 'Green', 'Yellow', 'Black']
states = ['Andhra', 'Karnataka', 'TamilNadu', 'Kerala']
neighbors = {}
neighbors['Andhra'] = ['Karnataka', 'TamilNadu']
neighbors['Karnataka'] = ['Andhra', 'TamilNadu', 'Kerala']
neighbors['TamilNadu'] = ['Andhra', 'Karnataka', 'Kerala']
neighbors['Kerala'] = ['Karnataka', 'TamilNadu']