Skip to content

Instantly share code, notes, and snippets.

View bear454's full-sized avatar

James Mason bear454

View GitHub Profile
@bear454
bear454 / README.md
Created February 14, 2020 18:27
Terraform "Hello, World" app

I needed an exceptionally simple terraform script with no external dependencies, but a variable input... and everything I found during a minute of Googling was overkill. So... "Hello, World." it is.

This is a great test script for blue-horizon.

# ~/bin/git-resync-fork
# assumes you have the upstream project as a git remote named 'upstream'
git checkout master
git fetch upstream master
git reset --hard upstream/master
git push --force
@bear454
bear454 / PS1
Created January 11, 2016 20:05
My bash prompt
#!/bin/bash
# Configure Colors:
# Reset
Color_Off='\[\e[0m\]' # Text Reset
# Regular Colors
Black='\[\e[0;30m\]' # Black
Red='\[\e[0;31m\]' # Red
Green='\[\e[0;32m\]' # Green
@bear454
bear454 / designer.html
Last active August 29, 2015 14:14
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@bear454
bear454 / designer.html
Last active August 29, 2015 14:14
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="linuxtycooon-app">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@bear454
bear454 / original.rb
Created May 27, 2014 17:02
conference date string refactor
def conference_date_string(conf)
startstr = "Unknown - "
endstr = "Unknown"
# When the conference in the same motn
if conf.start_date.month == conf.end_date.month and conf.start_date.year == conf.end_date.year
startstr = conf.start_date.strftime("%B %d - ")
endstr = conf.end_date.strftime("%d, %Y")
elsif conf.start_date.month != conf.end_date.month && conf.start_date.year == conf.end_date.year
startstr = conf.start_date.strftime("%B %d - ")
endstr = conf.end_date.strftime("%B %d, %Y")
@bear454
bear454 / dot-net-guid.rb
Created February 25, 2014 21:18
.net is *evil*: example.
# Convert a string in the expected format, into 16 bytes, emulating .Net's
# Guid constructor.
# "00000000-0000-0000-0000-000000000000" =>
# [CLSCompliantAttribute(false)]
# public Guid(
# uint a,
# ushort b,
# ushort c,
# byte d,
# byte e,
1
00:00:00,000 --> 00:00:00,800
Gravel.
2
00:00:00,900 --> 00:00:01,900
WARNING UNEXPECTED TAKEOFF
3
00:00:02,000 --> 00:00:04,000
@bear454
bear454 / gnome-music-all-albums.patch
Last active December 26, 2015 03:58
Tell gnome-music to load *all my albums*.
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index 13d77f0..0d8983b 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -87,7 +87,7 @@ class Grilo(GObject.GObject):
def populate_artists(self, offset, callback):
self.populate_items(Query.ARTISTS, offset, callback)
- def populate_albums(self, offset, callback, count=50):
+ def populate_albums(self, offset, callback, count=-1):
@bear454
bear454 / menlo.html
Created October 14, 2013 21:55
'Menlo' font not triggering non-monospaced render on Chrome/Android.
<!doctype html>
<html>
<head>
<style>
.monospace {
font-family: Menlo, Monaco, "Droid Sans Mono", Consolas, "Lucida Console", "Courier New", monospace;
}
.monospace_without_menlo {
font-family: Monaco, "Droid Sans Mono", Consolas, "Lucida Console", "Courier New", monospace;