Skip to content

Instantly share code, notes, and snippets.

@bambooom
bambooom / puppeteer-gif.js
Last active May 15, 2024 00:44
use puppeteer to generate gif
const fs = require('fs');
const puppeteer = require('puppeteer');
const GIFEncoder = require('gifencoder');
const PNG = require('png-js');
function decode(png) {
return new Promise(r => {png.decode(pixels => r(pixels))});
}
@jamesarosen
jamesarosen / ember-popover.md
Last active January 16, 2020 02:42
A Simple Ember-Popover

I looked around for a good popover library for Ember. I couldn't find one I liked (and was compatible with Ember 1.13 and Glimmer), so I whipped up a little ditty:

{{!-- app/pop-over/template.hbs --}}
{{yield}}
// app/pop-over/component.js
import $ from "jquery";
@marten-de-vries
marten-de-vries / README.md
Last active June 27, 2024 13:57
Running CouchApps on PouchDB in the browser using service workers - without any modifications!

Running CouchApps on PouchDB in the browser using service workers

What is this?

A description of how to run an existing CouchApp on PouchDB in the browser using service workers - without any modifications to existing code being necessary! The best thing is that if service workers aren't available, the CouchApp will still run as normal: that is, online.

Demo

@kevinkarwaski
kevinkarwaski / install-brew.sh
Last active July 22, 2024 20:34
Install Brew and set up for Standard OSX User
#!/usr/bin/env bash
# This script installs brew and chowns the right directories needed to run
# brew as a standard user. Your user should be the owner of /usr/local which
# gets set during the installation of brew. The global homebrew cache directory
# group should be set to 'staff' which is not set during a brew install. This
# script fixes that.
# To begin, you MUST execute this script with your user account while it has
# admin privileges. Once the script completes, you can change your
@tim-evans
tim-evans / document_title.js
Created August 22, 2014 19:28
Document title mixin for Ember.Router
import Ember from "ember";
var get = Ember.get;
var copy = Ember.copy;
var removeObserver = Ember.removeObserver;
var addObserver = Ember.addObserver;
var DocumentTitleMixin = Ember.Mixin.create({
titleTokensDidChange: function () {
@pandurang90
pandurang90 / openssl.cnf
Last active October 31, 2022 14:30
configure openssl.cnf
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
@lordhumunguz
lordhumunguz / Sample_Gruntfile.coffee
Last active August 29, 2015 14:02
A sample grunt file for {blog url}
module.exports = (grunt) ->
timestamp = Date.now().toString()
grunt.initConfig
env: grunt.file.readJSON '.env.json'
s3:
options:
key: '<%= env.AWS.AccessKeyId %>'
secret: '<%= env.AWS.SecretKey %>'
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active November 11, 2024 22:46
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@mixonic
mixonic / vcr_proxy.js
Last active January 1, 2016 00:59
Ember.js VCRProxy
// Record changes to an ObjectProxy and allow them to be stepped through
// or jumped to.
//
// For an example, see http://emberjs.jsbin.com/EJEcoxO/12/edit?html,js,output
//
// There is a bower/npm installable version of this library on GitHub:
// https://github.com/mixonic/ember-vcr-proxy
//
(function (global) {