Skip to content

Instantly share code, notes, and snippets.

View sukima's full-sized avatar

Devin Weaver sukima

View GitHub Profile
@sukima
sukima / Makefile
Last active December 14, 2018 17:45
Makefile for compiling PlantUML diagrams
# Makefile for PlantUML
# Author: Devin Weaver (@sukima) <suki@tritarget.org>
# GistID: 52eacde54bf7861b19ee66a07b864583
#
# This handles SVGs PNGs and ASCII outputs.
# It handles included files with the .iuml extension: !include foo.iuml
# All diagrams have the .uml extension and reside in the diagrams directory
# All output is saved to the output directory
#
# make svg - (default) build all diagrams as SVGs
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active April 26, 2024 11:53
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@BrianSipple
BrianSipple / ember-addon-readme-badge-template.md
Last active September 7, 2020 10:06
Useful Badges to Include in an Ember Addon's README
[![Latest NPM release][npm-badge]][npm-badge-url]
[![TravisCI Build Status][travis-badge-url]][travis-project-url]
[![CircleCI Build Status][circle-badge]][circle-badge-url]
[![Test Coverage][coveralls-badge]][coveralls-badge-url]
[![Code Climate][codeclimate-badge]][codeclimate-badge-url]
[![Ember Observer Score][ember-observer-badge]][ember-observer-badge-url]
[![License][license-badge]][license-badge-url]
[![Dependencies][dependencies-badge]][dependencies-badge-url] 
[![Dev Dependencies][devDependencies-badge]][devDependencies-badge-url]
@schickm
schickm / gist:08ec48667a4d43e59d91
Last active September 24, 2017 21:33
Ember Dynamic aliases
import Ember from 'ember';
export default Ember.Object.extend({
model: null,
subpath: null,
dynamicModelProperty: Ember.computed('model', 'subpath', function() {
let subpath = this.get('subpath');
if ( subpath ) {
@cowboyd
cowboyd / wrap-promise-helper.js
Last active March 31, 2016 01:38
An Ember helper to project a promise into a stream of POJO states
import Ember from 'ember';
export default Ember.Helper.extend({
compute([promise]) {
if (this.promise !== promise) {
this.promiseState = new PromiseState();
this.promise = promise;
this.promise.then((result)=> {
this.promiseState = this.promiseState.resolve(result);
this.recompute();
@sukima
sukima / maybe.js
Last active May 2, 2024 05:47
Simple Maybe monad utility for dealing with lookup on objects, etc. (1.8kb minified)
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
@raganwald
raganwald / flip-flop-merge-sort.js
Last active April 27, 2016 04:38
Merge Sort in JavaScript
const sorted = arr => {
const length = arr.length;
let unsorted = new Array(length),
sorted = new Array(length);
const destructiveSort = (unsorted, sorted, offset, length) => {
if (length === 1) {
sorted[offset] = unsorted[offset];
}
@sukima
sukima / BetterCommitMessages.md
Last active May 10, 2024 00:08
My guidelines for writing better commit messages
import Ember from 'ember';
import FlashMessage from 'ember-cli-flash/flash/object';
var {
computed,
get,
run
} = Ember;
export default Ember.Object.extend({
@zenparsing
zenparsing / dedent-template.js
Last active April 25, 2023 22:16
Dedenting Template Strings
function dedent(callSite, ...args) {
function format(str) {
let size = -1;
return str.replace(/\n(\s+)/g, (m, m1) => {
if (size < 0)
size = m1.replace(/\t/g, " ").length;