Skip to content

Instantly share code, notes, and snippets.

View drewlustro's full-sized avatar
💭
on windoze

Drew Lustro drewlustro

💭
on windoze
View GitHub Profile
@drewlustro
drewlustro / Remapkey.bat
Created August 1, 2017 03:36
Run cmd.exe as administrator in Windows and use this tool to remap any modifier keys to macOS
Remapkey.exe
@indefinit
indefinit / OLA.md
Last active September 30, 2017 04:52
Random learnings from the project discovery phase

Learnings from working with Open Lighting Architecture for Mac OSX 10.9.5:

On compiling the OLA library from source

Getting the OLA c++ source, compiling it, and running the OLA daemon with Max/MSP to send pixel control data over E131.

  • I had a lot of initial trouble getting OLA to compile and run on my system. My goal was to eventually control LEDs with DMX/E131 protocol using Max or another client application (built in Openframeworks, Cinder, or Processing).
  • I found that my library compile problems were coming from Macports. The Official OLA documentation recommends installing with Macports but in practice Homebrew was a better option for me. Here is some info on Homebrew. http://brew.sh/ Once you have homebrew installed, you should be able to run the command brew install ola --universal in your terminal, which will install OLA to /usr/local/Cellar and symlink to /usr/local/lib directory. Sometimes homebrew installs the package but does not link it. You may have to run
@abhishekjairath
abhishekjairath / nodobjc-macOS-notification-listener.js
Created March 12, 2017 06:33
Using 'nodobjc' a nodeJS->ObjectveC bridge to listen to distributed notification centre of macOS/OSX.
var $ = require('nodobjc')
$.framework('Foundation')
$.framework('AppKit')
var GetSongs = $.NSObject.extend('Delegate');
GetSongs.addMethod('getMySongs:', 'v@:@', function(self, _cmd, notif){
var userInfo = notif('userInfo')
var keys = userInfo('keyEnumerator');
@mrdanadams
mrdanadams / _pems.scss
Created March 29, 2012 13:32
PX to EMs conversion in Sass
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;
@scottwb
scottwb / nginx_subdomain.conf
Created January 25, 2011 16:38
Nginx config to route domain and subdomains, except for explicit virtual hosts, to the www subdomain.
http {
# Default virtual host for www.example.com. This will pick up all HTTP
# requests to port 80 that are not for one of the other virtual hosts.
server {
listen 80;
server_name www.example.com;
# ...your server config here...
@Arjeno
Arjeno / circle.yml
Created August 17, 2016 13:57
Always use the latest version of Chrome on CircleCI
# This makes sure Chrome is always up to date in your test suite
# On average this adds about 10 seconds to your build suite
# Be sure to use Ubuntu 14.04 (Trusty) in the CircleCI's OS setting (Settings > Build Environment)
dependencies:
pre:
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb
@koycarraway
koycarraway / _vars-social-colors.scss
Last active April 7, 2020 05:34
Sass color variables for popular brands and social media.
// Social Colors
// ====================================================================
$facebook_color : hsla(222, 47%, 40%, 1); // #365397
$twitter_color : hsla(198, 100%, 47%, 1); // #00a9f1
$linkedin_color : hsla(203, 100%, 35%, 1); // #006db3
$apple_color : hsla(0, 0%, 45%, 1); // #737373
$google_color : hsla(217, 89%, 61%, 1); // #4285f4
$google_plus_color : hsla(8, 74%, 53%, 1); // #e0452c
@jamescmartinez
jamescmartinez / slack_delete.rb
Last active January 4, 2021 21:28
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@somebody32
somebody32 / README.md
Last active April 25, 2022 18:24
Tailwind purging + external components library

Prerequisites

  1. The app that uses tailwind + external component library (CL) (but not 3rdparty, your company internal one, for example)
  2. The component library also uses tailwind

The goal

To be able to purge safely unused tailwind classes from the build (https://tailwindcss.com/docs/controlling-file-size)

Solution

The idea here is simple: we're going to purge css on the app side + whitelist classes that component library is using.