Skip to content

Instantly share code, notes, and snippets.

View kuatsure's full-sized avatar

Jarrett Drouillard kuatsure

View GitHub Profile
@kuatsure
kuatsure / colortrans.py
Created July 12, 2017 21:39 — forked from MicahElliott/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
for f in app/models/*;
do
NAME=${f##*/}
echo mkdir "app/pods/${NAME%.*}";
echo mv "$f" "app/pods/${NAME%.*}/model.js";
done;
@kuatsure
kuatsure / fizzbuzz.go
Last active July 13, 2016 16:30
FizzBuzz across multiple languages
// A concurrent prime sieve
package main
import "fmt"
// Send the sequence 2, 3, 4, ... to channel 'ch'.
func Generate(ch chan<- int) {
for i := 2; ; i++ {
ch <- i // Send 'i' to channel 'ch'.
@kuatsure
kuatsure / themer.scss
Created August 21, 2015 14:27
sass maps and loops for compiling theme logic in a core.css
// Themes list and color maps
$themes: (
'base': (
brand-color: #1ab6df,
main-nav-bg: #204474,
bg-mod-one: #ee6700,
bg-mod-two: #0077b4,
bg-mod-three: #009bac,
bg-mod-four: #008b45,
bg-mod-five: #204474,
@kuatsure
kuatsure / x.html
Created May 12, 2015 20:53
example picture element from an event apart digest issue 3
<picture>
<source type="image/svg+xml" srcset="pic.svg">
<img src="pic.png" alt="…">
</picture>
@kuatsure
kuatsure / SassMeister-input.scss
Created March 31, 2015 02:14
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
/// Original idea from Harry Roberts
/// http://sassmeister.com/gist/20b62018e8143bc7f3fc
/// I pushed it a bit further by allowing subkeys in themes.
@kuatsure
kuatsure / SassMeister-input.scss
Created March 31, 2015 01:16
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
/*
This is a mixin that allows you to dynamically create selectors on anything.
This is useful for split text animations, like below.
JS to split text into individual parts:
@kuatsure
kuatsure / ember-slack-theme.csv
Created March 27, 2015 14:00
sidebar theme for slack - emberized
#F4ECE9 #F3735D #F2D1CB #444444 #F2D1CB #444444 #E1563F #E1563F
@kuatsure
kuatsure / SassMeister-input-HTML.html
Created March 5, 2015 16:27
Generated by SassMeister.com.
<div class='page'>Cras lorem ligula, pretium a purus nec, elementum aliquam est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam blandit maximus neque a venenatis. Praesent in nibh lobortis, luctus lectus non, suscipit dolor. Morbi vel lacus dignissim, rhoncus turpis sed, consequat ipsum. Sed egestas volutpat arcu eget efficitur. Interdum et malesuada fames ac ante ipsum primis in faucibus. In id laoreet arcu. Pellentesque sollicitudin molestie lacus non efficitur. Quisque viverra erat vel eros rutrum, a ultrices quam luctus.Cras lorem ligula, pretium a purus nec, elementum aliquam est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam blandit maximus neque a venenatis. Praesent in nibh lobortis, luctus lectus non, suscipit dolor. Morbi vel lacus dignissim, rhoncus turpis sed, consequat ipsum. Sed egestas volutpat arcu eget efficitur. Interdum et malesuada fames ac ante ipsum primis in faucibus. In id lao
@kuatsure
kuatsure / docIconHelper.coffee
Created March 2, 2015 19:27
quick switch to grab image path based on extension
app.docIconHelper = ( extension ) ->
switch extension
when 'xlsx', 'xls' then icon = 'excel'
when 'docx', 'doc' then icon = 'word'
when 'pptx', 'ppt' then icon = 'powerpoint'
when 'bmp', 'png', 'jpg', 'jpeg' then icon = 'image'
when 'html', 'aspx', 'htm', 'asp', 'php' then icon = 'link'
when 'pdf' then icon = 'pdf'
when 'mov', 'mp4' then icon = 'video'
else icon = 'blank'