Skip to content

Instantly share code, notes, and snippets.

View ckollars's full-sized avatar

Christopher Kollars ckollars

View GitHub Profile
@ckollars
ckollars / electric_objects.py
Created June 1, 2017 15:59 — forked from harperreed/electric_objects.py
Electric objects simple API wrapper
import requests
import urllib
import requests
import json
import random
"""
here is a wrapper for the *unreleased* electric objects API
Built by Harper Reed ([email protected]) - @harper
@ckollars
ckollars / LICENSE.txt
Created September 26, 2016 19:40 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ckollars
ckollars / iterm2.md
Created August 30, 2016 04:36
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@ckollars
ckollars / gist:76e4c88aba1043e7dae9
Last active September 10, 2015 22:54 — forked from billerickson/gist:3698476
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@ckollars
ckollars / config.scss
Created June 16, 2015 18:31
A new set of breakkpoints
/**
* RWD Breakpoints for layout changes
*/
$breakpoints: (
// Layout breakpoints
'mobile-portrait' : ( max-width: 639px ),
'mobile-landscape' : ( min-width: 640px ),
'small' : ( min-width: 768px ),
'medium' : ( min-width: 800px ),
'large' : ( min-width: 1000px ),
function wp_api_encode_acf($data,$post,$context){
$data['meta'] = array_merge($data['meta'],get_fields($post['ID']));
return $data;
}
if( function_exists('get_fields') ){
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3);
}
@ckollars
ckollars / mixins.scss
Created April 22, 2015 14:05
Custom SASS mixin for sticky header not conflicting with WP Admin menu
// Taken from James Steinbach article
// http://www.sitepoint.com/getting-sticky-headers-wordpress-admin-bar-behave/
@mixin admin-sticky-fix( $offset: 0 ) {
$narrow-offset: 46px;
$wide-offset: 32px;
@if $offset != 0 and type-of($offset) == 'number' {
$narrow-offset: $narrow-offset + $offset;
$wide-offset: $wide-offset + $offset;
}
.admin-bar & {
@ckollars
ckollars / main
Last active August 29, 2015 14:16
Animating both display and transform
@keyframes grow {
0% {
display: none;
opacity: 0;
}
1% {
display: block;
opacity: 0;
transform: scale(0);
}
@mixin respond-to($name) {
// Retrieves the value from the key
$value: map-get($breakpoints, $name);
// If the key exists in the map
@if map-has-key($breakpoints, $name) {
// Prints a media query based on the value
@media #{inspect(map-get($breakpoints, $name))} {
@content;
}