Skip to content

Instantly share code, notes, and snippets.

View frozzare's full-sized avatar
😎
Focusing

Fredrik Forsmo frozzare

😎
Focusing
View GitHub Profile
function lpg_get_attachment( $attachment_id ) {
$attachment = get_post( $attachment_id );
return array(
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
'caption' => $attachment->post_excerpt,
'description' => $attachment->post_content,
'href' => get_permalink( $attachment->ID ),
'src' => $attachment->guid,
'title' => $attachment->post_title
);
@frozzare
frozzare / vvv-work.sh
Last active August 29, 2015 14:22
Simple script to setup a new vvv site with folder prefix
#!/bin/bash
folder_name="site"
folder_prefix="work/" # folder prefix, /srv/vvv/www/$folder_prefix$folder_name
db_name="db_name"
db_user="root"
db_password="root"
db_host="localhost"
wp_env="development"
wp_home="http://$folder_name.dev"
personnummer.luhn:
cmpq %fs:112, %rsp
jae .L12
movl $152, %r10d
movl $0, %r11d
call __morestack
ret
.L12:
pushq %rbp
movq %rsp, %rbp

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

type JSONContainer struct {
data []interface{}
}
func (j *JSONContainer) All() (objects []JSONObject) {
for _, v := range j.data {
objects = append(objects, JSONObject{data: v})
}
return
}
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
# GIT / GIT FLOW ALIASES
alias gs="git stash"
alias gsa="git stash apply"
alias gsl="git stash list"
alias gsc="git stash clear"
alias gft="git fetch --tags"
alias gpt="git push --tags"
alias gcm="git checkout master"
@frozzare
frozzare / git-release
Last active August 29, 2015 14:13 — forked from chsh/git-release
#!/bin/sh
pfx='rel'
d=`date +%Y%m%d%H%M%S`
git flow release start $pfx-$d
git flow release finish -m"Release:$d" $pfx-$d