Skip to content

Instantly share code, notes, and snippets.

@cramforce
cramforce / elgato-key-light-smartthings-device-handler.groovy
Last active February 23, 2023 06:20
A SmartThings Device Handler for Elgato Key Light
/**
* Copyright 2020 Malte Ubl
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@kentbrew
kentbrew / pinmarklet.md
Last active March 25, 2024 17:49
How to recreate your long-lost Pinterest bookmarklet.

How to recreate your long-lost Pinterest bookmarklet.

Right-click your bookmarks bar and choose Add Page (Chrome) or New Bookmarklet (Firefox).

In Name, put this:

Pin It

In URL, put this:

using UnityEngine;
using UnityEditor;
using System.IO;
// example PostProcessor for adjusting automatic Sprite Import settings
// save this in any "Editor" Folder
public class SpriteImportProcessor : AssetPostprocessor
{
void OnPostprocessSprites(Texture2D texture, Sprite[] sprites)
{
@etes
etes / pi_mount_usb.md
Last active March 14, 2024 17:31
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@danharper
danharper / gulpfile.js
Last active May 1, 2023 01:23
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@lsd
lsd / IdeaVim OS X Key Repeat.markdown
Last active December 12, 2023 18:09
Enable key-repeat for ALL applications or just for IdeaVim/specific JetBrains apps

Upgrading to Lion or Yosemite and WebStorm 9, I noticed key repeat was
turned off for the IdeaVim plugin h j k l keys.

System-wide key repeat

defaults write -g ApplePressAndHoldEnabled -bool false in a terminal will enable
key repeat for every app. This can alternatively be found in the accessibility settings in OS X' preferences.

App specific key repeat

@cristobal
cristobal / osx-openfl-install.sh
Created April 1, 2014 07:34
OSX Openfl Install
# Install Haxe using Brew and set the haxelib path
brew install haxe
haxelib setup /usr/local/Cellar/haxe/lib
# Install lime
haxelib install lime
haxelib run lime setup
# Install lime tools
haxelib install format
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else