Skip to content

Instantly share code, notes, and snippets.

@sirmews
sirmews / fishdefault
Created June 16, 2014 05:30
setting fish shell as default on OS X
echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/fish
@sirmews
sirmews / disablespotlight
Created June 24, 2014 03:20
Disable Spotlight on OS X
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
@sirmews
sirmews / disableanimations
Created June 24, 2014 05:23
Disable OS X desktop animations
# window animation
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO
# mail.app animation
defaults write com.apple.Mail DisableReplyAnimations -bool YES
defaults write com.apple.Mail DisableSendAnimations -bool YES
# mission control animation
## disable
defaults write com.apple.dock expose-animation-duration -int 0
@sirmews
sirmews / simpleserver
Created June 24, 2014 07:36
Run simple server from directory
# python
python -m SimpleHTTPServer 8080
# php
php -S localhost:8080
@sirmews
sirmews / checksum
Created June 24, 2014 07:58
Generate checksum on OS X
# sha256
shasum -a 256 <file>
# sha1
shasum -a 1 <file>
# md5
md5 <file>
var React = require('react');
var ReactDOM = require('react-dom');
var ReactRouter = require('react-router');
var useRouterHistory = ReactRouter.useRouterHistory;
var History = require('history');
var createHashHistory = History.createHashHistory;
var histories = useRouterHistory(createHashHistory)({ queryKey: false });
var Link = ReactRouter.Link;
module.exports = React.createClass({
@sirmews
sirmews / Contract Killer 3.md
Created December 7, 2016 07:53
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@sirmews
sirmews / inputfieldfile-form.php
Created January 11, 2017 09:16 — forked from somatonic/inputfieldfile-form.php
ProcessWire front-end upload form example using ProcessWire Inputfields and form processing.
<?php
/**
* ProcessWire (2.5) InputfieldFile front-end upload form example
* Various workarounds to get it working with Errors for WireUpload
* and removing files upload after error
*/
$sent = false;
$upload_path = $config->uploadTmpDir;
@sirmews
sirmews / afplay-multiple.sh
Created January 17, 2017 22:30
Play all mp3 files in current directory with afplay
#!/bin/bash
find . -name '*.mp3' -exec afplay '{}' \;
@sirmews
sirmews / space_to_underscore.sh
Created January 2, 2018 05:47
Convert all spaces to underscore with bash
for name in *; do mv "$name" "${name// /_}"; done