Skip to content

Instantly share code, notes, and snippets.

View hypebeast's full-sized avatar

Sebastian Ruml hypebeast

  • Atlantic Ventures GmbH
  • Munich
View GitHub Profile

Architectural Questions

  • Are responsibilities well defined?
  • Are the collaborations well defined?
  • Is coupling minimized?
  • Can you identify potential duplication?
  • Are interface definitions and constraints acceptable?
  • Can modules access needed data—when needed?
@hypebeast
hypebeast / Gruntfile.js
Created September 19, 2013 21:45
Sample Gruntfile.js for Yeoman to use with CoffeScript and require.js.
// Generated on 2013-09-14 using generator-webapp 0.4.2
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@hypebeast
hypebeast / gist:4207975
Created December 4, 2012 19:50
tmux config file (tmux.conf)
unbind C-b
set -g prefix C-a
unbind %
bind . split-window -h
bind - split-window -v
bind-key k select-pane -U
bind-key j select-pane -D
bind-key h select-pane -L
bind-key l select-pane -R
@hypebeast
hypebeast / remote_process.ps1
Last active October 12, 2015 18:08
Monitor a remote process with PowerShell
# Returns the path of the executing script
function Get-ScriptDirectory
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
# Process name
$processName = "notepad++"
@hypebeast
hypebeast / gist:3833758
Created October 4, 2012 14:12
CRC8 calculation
class crc8:
def __init__(self):
self.crcTable = (0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38,
0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77,
0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46,
0x41, 0x54, 0x53, 0x5a, 0x5d, 0xe0, 0xe7, 0xee, 0xe9,
0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4,
0xc3, 0xca, 0xcd, 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b,
0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba,
0xbd, 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2,
def enumerate_serial_ports():
""" Uses the Win32 registry to return an
iterator of serial (COM) ports
existing on this computer.
"""
path = 'HARDWARE\\DEVICEMAP\\SERIALCOMM'
try:
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path)
except WindowsError:
raise IterationError
@hypebeast
hypebeast / check_sum.py
Created December 28, 2011 17:43
Calculate the checksum of a file
#!/usr/bin/env python
'''
Per's SFV is a simple Simple File Verificator that you can use to
verify that a file has not changed.
Copyright (C) 2006 Per Myren <per.myren@gmail.com>
Distributed under the GPL v2
modified by jason moiron to remove wx cruft and to allow file objects
as arguments to CheckSum()