Skip to content

Instantly share code, notes, and snippets.

func sendSingleFrame(c echo.Context) error {
// Initialize a Buffer
buf := new(bytes.Buffer)
// Grab the file from the filesystem
imgFile, _ := os.Open("cool.gif")
// If you try and decode the image you'll
// only find the first frame of the gif
g, _ := gif.Decode(imgFile)
@jonwinton
jonwinton / works.go
Created May 11, 2019 03:08
Adventures In Golang: Animated Gif Functional
func sendGif(c echo.Context) error {
// Initialize a Buffer (https://golang.org/pkg/bytes/#Buffer)
// This is where we'll write gif data too so that it can be
// read from via the http server
buf := new(bytes.Buffer)
// Grab the file from the filesystem
imgFile, _ := os.Open("cool.gif")
// We want to break apart all the frame data to make sure we
@jonwinton
jonwinton / .eslintrc
Created April 10, 2016 19:20
Webpack .eslintrc file
{
// http://eslint.org/docs/rules/
"parser": "babel-eslint",
"ecmaFeatures": {
"arrowFunctions": true, // enable arrow functions
"binaryLiterals": false, // enable binary literals
"blockBindings": true, // enable let and const (aka block bindings)
"classes": true, // enable classes
"defaultParams": true, // enable default function parameters
"destructuring": true, // enable destructuring
@jonwinton
jonwinton / IsVisuallyHidden
Created April 4, 2016 23:41
A mixin for visually hiding content in an accessible way
@mixin isVisuallyHidden() {
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
border: 0;
position: absolute;
clip: rect(0 0 0 0);
overflow: hidden;
}
/**
* A simple module for abstracting styling away
* from a specific heading element. Add modifiers
* for color, font-weight, etc. as you need them.
*
* Need More sizes? Add more. Just don't style an
* element contextually, leverage a CSS module/object/thing
*/
.hdg {
@jonwinton
jonwinton / isVisuallyHidden.scss
Created September 15, 2015 18:04
IsVisuallyHidden
@mixin isVisuallyHidden() {
width: 1px !important;
height: 1px !important;
padding: 0;
margin: -1px;
border: 0;
position: absolute !important;
clip: rect(0 0 0 0);
overflow: hidden;
}
ComponentModule.directive('test', [
'RequestService',
function(
RequestService
) {
return {
scope: true,
link: function(scope, element, attrs) {