Skip to content

Instantly share code, notes, and snippets.

View matt-d-rat's full-sized avatar

Matt Fairbrass matt-d-rat

View GitHub Profile
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
css: {
files: ['styles/*'],
tasks: ['sass', 'cssmin', 'copy:css']
},
@mikomatic
mikomatic / ng-prism.js
Created July 17, 2014 14:02
Angularjs directive with prism code highlight
/**
* Usage
*
* <ng-prism class="language-css">
* body {
* color: red;
* }
* </ng-prism>
*
* the files prismjs and prism css must be included in HTML, use class "language-XXX" to specify language
@spoike
spoike / webapi_example.js
Last active May 12, 2017 13:37
Simple WebAPI example
var PostsApi = require('webapi/posts'),
// assuming the api object from the jsbin snippet
Reflux = require('reflux');
var PostActions = createActions(["load", "loadError"]);
// load action is invoked either from:
// * top most component's componentDidMount
// function in your application, or
// * window.onLoad
// I prefer the first strategy because that'll
#!/usr/bin/env zsh
branch=`git rev-parse --abbrev-ref HEAD`
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
# How it works:
# 1| Display a textual history of all commits.
# 2| Ancestors of the current commit are indicated
# by a star. Filter out everything else.
@stereobooster
stereobooster / 0-react-maps.md
Last active August 16, 2023 12:19
React Maps
[Raster tiles][rt] [Vector tiles][vt] GeoJSON virtual-dom offline map quality React component React Native
google maps + + good [4 unsupported][gm-react] [+][gm-native]
leaflet * + [+][ll-vt] + [+/-][ll-offline] depends [+][ll-rect]
d3 * + [+/-][d3-vdom] +/- depends [+][d3-react]
MapboxGL + + depends [+][mb-react] [+][mb-native]
Yandex Maps +
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus