Skip to content

Instantly share code, notes, and snippets.

@Melindrea
Melindrea / git-prompt.sh
Last active December 13, 2015 21:18 — forked from presstube/gist:1299452
Main update from the fork and the awesome post by opinionated programmer is that the default prompt is based on the Ubuntu one, and allows to show Python's virtual environment. Add the snippet to .bash_profile or .bashrc
# Snazzy git prompt
#http://www.opinionatedprogrammer.com/2011/01/colorful-bash-prompt-reflecting-git-status/
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43
@Melindrea
Melindrea / nav.php
Last active December 15, 2015 19:08
Unorganized (for now) elements of snippets/tools/stuff for WordPress
/**
* Remove the id="" on nav menu items
* Return 'menu-slug' for nav menu classes
* Set 'current-menu' etc to 'active', 'active-parent', 'active-ancestor'
* Based on roots
*/
function pb_nav_menu_css_class($classes, $item) {
$slug = sanitize_title($item->title);
$classes = preg_replace('/current-(menu|page)-(parent|ancestor)/', 'active-$2', $classes);
$classes = preg_replace('/(current([-_](menu|page)[-_])(item|parent|ancestor))/', 'active', $classes);
@Melindrea
Melindrea / call.js
Last active December 16, 2015 07:59
jQuery Plugin for making boxes equal heights
// Window.load to avoid FOUC in some browsers
$(window).load( function() {
/* Make boxes same height */
$('.js-equal-height-columns-row').sameHeights();
});
@Melindrea
Melindrea / elements.html
Last active December 16, 2015 10:29
HTML5 elements, as a base for testing styles
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Test display of HTML elements</title>
<!-- Originally from: http://www.cs.tut.fi/~jkorpela/www/testel.html -->
</head>
/* Checks to make sure that all images have alt attributes, even if they're empty */
@all (content-type = /^text\/html/) {
img {
has-attribute(alt): true;
}
}
@Melindrea
Melindrea / menus.html
Last active November 30, 2016 15:55
Patterns to use aria roles, both HTML and a sketch for the CSS
<!-- navigational menubar (with drop down submenu, without works as well) -->
<nav aria-label="main" role="navigation"><!-- role explicit for older browsers, using aria-label to differentiate from other navs -->
<ul role="menubar" aria-activedescendant="home-menuitem">
<li role="presentation">
<a href="#" role="menuitem" aria-selected="true" id="home-menuitem">Home</a></li>
<li role="presentation">
<a href="#" role="menuitem" aria-selected="false" id="link-menuitem">Link</a>
</li>
<li role="presentation">
<!-- using button to be triggered on-click -->
@Melindrea
Melindrea / pre-commit-grunt
Created September 27, 2013 06:37
List of Git hooks
#!/bin/sh
# http://gmurphey.com/2012/12/22/grunt-pre-commit-hook-for-release-tasks.html
# stash unstaged changes, run release task, stage release updates and
# restore stashed files
# Should now hopefully have correct line endings...
NAME=$(git branch | grep '*' | sed 's/* //')
# don't run on rebase
if [ $NAME != '(no branch)' ]; then
@Melindrea
Melindrea / Gruntfile.js
Created October 29, 2013 20:39
PHP tasks for grunt
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// show elapsed time at the end
- Next!
- Hello there.
- Is today tomorrow in New Zealand?
- Yes.
- Foot same length Europe
- What?
- Inch same length Europe

When my grandmother was young, her parents Alma and Olof Frid (which, yes, is where I got Vendela's surname from), had foster children at least occasionally.

One such child was a little girl whose mother had died (I don't know where the father was). The little girl was getting sicker, and at one point my grand-aunt was babysitting the child. She fell asleep, and when she woke up a woman dressed in white was leaning over the cradle. The woman picked up the child and walked away. My grand-aunt rushed over to the cradle. The child was dead.

Sometime later, my grand-aunt saw a photo of a young woman. She recognized the woman in the picture as the one she'd seen and asked who it was. That was the child's mother.

This is used in my story as something that Vendela's grandmother Elis tells her happened to her. The child in that story is a boy named Antonius, which is Olof Frid's middlename. As another touch of curiosa: Elis is named from my paternal grandfather's great-aunt. The farm that Vendela grew up on is lo