Skip to content

Instantly share code, notes, and snippets.

View cdeutsch's full-sized avatar
👨‍🏭
Hire me! Fullstack Engineer open to new developer or manager opportunities.

Christopher Deutsch cdeutsch

👨‍🏭
Hire me! Fullstack Engineer open to new developer or manager opportunities.
View GitHub Profile
@cdeutsch
cdeutsch / addDevMiddlewares.ts
Created April 9, 2018 14:24
Typescript Webpack, Node Server backend
import { Express } from 'express';
import path from 'path';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
const webpackConfig = require('../../../frontend/webpack/webpack.dev.config');
export function addDevMiddlewares(app: Express) {
const compiler = webpack(webpackConfig);
const middleware = webpackDevMiddleware(compiler, {
@cdeutsch
cdeutsch / toggle.scpt
Created March 22, 2018 17:51
Toggle mute on Discord with Apple Script
-- requires that "cmd+shift+m" is the keyboard shortcut for mute
on run
tell application "Discord" to activate
tell application "System Events"
-- toggle mute
keystroke "m" using {command down, shift down}
-- cmd+tab back to previous application
keystroke tab using {command down}
end tell
end run
@cdeutsch
cdeutsch / gist:a5e5b6ad6c2e5007da1a1d4b8e69893d
Created January 24, 2018 16:07
Mute Discord using AppleScript
tell application "Discord" to activate
tell application "System Events"
-- requires that you create a keyboard shortcut for cmd+shift+m
keystroke "m" using {command down, shift down}
keystroke tab using {command down}
end tell
@cdeutsch
cdeutsch / toggle.scpt
Created January 19, 2018 23:01
Toggle iTerm FocusFollowsMouse
activate application "iTerm"
tell application "System Events" to tell application process "iTerm2"
-- open the preferences or bring to front (window 1)
keystroke "," using {command down}
delay 0.1
-- Change to the General tab
click button "Pointer" of toolbar 1 of window 1
delay 0.1
@cdeutsch
cdeutsch / gist:490103d3610a5ce9f42d
Created May 27, 2015 15:06
Formsy React Addons
var React = require('react/addons')
, cx = require('classnames')
, Formsy = require('formsy-react')
;
Formsy.AddonMixin = {
propTypes: {
groupClassName: React.PropTypes.oneOfType([
React.PropTypes.array,
var React = require('react/addons')
, cx = require('classnames')
, Formsy = require('formsy-react')
;
Formsy.Input = React.createClass({
mixins: [Formsy.Mixin],
propTypes: {
groupClassName: React.PropTypes.oneOfType([
public static void Log (Exception ex, ReportSeverity severity= ReportSeverity.Error,
[CallerMemberName] string memberName = "",
[CallerFilePath] string sourceFilePath = "",
[CallerLineNumber] int sourceLineNumber = 0)
{
try{
Console.WriteLine (ex);
Console.WriteLine("{0} - {1} - {2} \r\n {3}",sourceFilePath,memberName,sourceLineNumber,ex);
@cdeutsch
cdeutsch / gist:bfac8f8ccd1c678e30ed
Created February 10, 2015 18:11
Replacement for Sugar Object.objectToQueryString that doesn't lose data
var yourApp = {};
yourApp.objectToQueryString = function(obj, base) {
var tmp;
// If a custom toString exists bail here and use that instead
if(Object.isArray(obj) || (Object.isObject(obj) && obj.toString === Object.prototype.toString)) {
tmp = [];
yourApp.iterateOverObject(obj, function(key, value) {
if(base) {
key = base + '[' + key + ']';
@cdeutsch
cdeutsch / gist:6e1ce81cd310a1f2aef8
Created February 9, 2015 13:20
dayone-timehop.js - Find out what happened in Day One on this day each year like Timehop
#! /usr/local/bin/node
// BASED OFF THIS SCRIPT: https://gist.github.com/aliou/7310354
var _ = require('underscore');
var DayOne = require('dayone').DayOne;
var DayOneEntry = require('dayone').DayOneEntry;
var moment = require('moment');
var path = require('path-extra');
var notifier = require('node-notifier');
# -*- coding: utf-8 -*-
import alfred
import calendar
import time
import math
from delorean import utcnow, parse, epoch, Delorean
# global var to see if user
# has a time offset