Skip to content

Instantly share code, notes, and snippets.

@jmahony
jmahony / script.php
Created May 31, 2013 16:16
WordPress: delete unwanted capabilities
<?php
// Function to delete capabilities
// http://chrisburbridge.com/delete-unwanted-wordpress-custom-capabilities/
add_action( 'admin_init', 'clean_unwanted_caps' );
function clean_unwanted_caps() {
global $wp_roles;
$delete_caps = array(
'capability1'
<?xml version="1.0" encoding="UTF-8"?>
<project name="sussexfire" default="build" basedir=".">
<description>
SussexFire
</description>
<property name="src" location="src"/>
<property name="build" location="build"/>
class A extends Activity implement Observer {
onCreate() {
B b = new B(new Handler() {
handleMessage(Msg msg) {
// update model
// Bad
if (user.authFlag() == AUTHORISED) {
// Code
}
// Good
if (user.isLoggedIn()) {
// Code
}

Update AUR packages with no confirmations

yaourt -Syu --aur --noconfirm
@jmahony
jmahony / dates.go
Created July 14, 2015 08:03
Print dates
package main
import (
"fmt"
"time"
)
var format = "02/01/2006"
var incrementInDays = 3
var amountOfDates = 5
@jmahony
jmahony / vim-notes.md
Last active October 2, 2015 07:37
Vim Notes

Vim Notes

Editing

guu Lowercase line

gUU Uppcase line

Searching

* search for other instances of the word under your cursor

@jmahony
jmahony / wrap_mixin.scss
Created November 30, 2015 11:31
Mixin that wraps content another selector
@mixin wrap($prefix) {
$selector: &;
@at-root #{$prefix} {
#{$selector} {
@content;
}
}
}
@jmahony
jmahony / colourise.js
Created November 30, 2015 17:03
Simple script to make things easier to line up
function coloursize() {
$('.colourise').each(function() {
var $el = $(this);
setBackgroundColour($el);
$el.find('*').each(function() {
setBackgroundColour($(this));
});