Skip to content

Instantly share code, notes, and snippets.

@brozkeff
brozkeff / dokuwiki2html.sh
Last active October 22, 2018 20:19 — forked from hugorodgerbrown/md_to_rst.sh
Shell script for converting a batch of *.txt dokuwiki-syntax files into *.html using dokuwiki2mediawiki and then pandoc.
# This script was created to convert a directory full
# of dokuwiki files into html. It uses dokuwiki2mediawiki.php for intermediate step converting to mediawiki, and
# pandoc to do the conversion from mediawiki to html.
#
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/
# 2. Copy this script into the directory containing the .txt files
# 3. Copy script (https://github.com/tstaerk/mediasyntax/blob/master/tools/dokuwiki2mediawiki.php) to the same directory, make sure you have PHP installed and capable running scripts
# 3. Ensure that the script has execute permissions
# 4. Run the script
#
@magnetikonline
magnetikonline / README.md
Last active September 21, 2022 05:34
Node.js HTTP receiving request dump server.

Node.js HTTP receiving request dump server

HTTP server which receives requests and dumps them to a flat file.

Usage

Start HTTP server:

$ nodejs ./httprequestdump.js
@aazwar
aazwar / xcode_ramdisk.sh
Last active November 26, 2020 19:45
Speed up XCode 7
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
# PREREQUISITE:
# mkdir /Users/$USERNAME/Library/Developer/Xcode/DerivedData.shadow
## Unless you clear DerivedData folder, you can't mount ramdisk on it
# rm -r /Users/$USERNAME/Library/Developer/Xcode/DerivedData/*
@gaearon
gaearon / reducers.js
Last active December 11, 2020 14:56
How I'd do code splitting in Redux (pseudo code, not tested!)
import { combineReducers } from 'redux';
import users from './reducers/users';
import posts from './reducers/posts';
export default function createReducer(asyncReducers) {
return combineReducers({
users,
posts,
...asyncReducers
});
@alexkirsz
alexkirsz / ForceCaseSensitivityPlugin.js
Last active February 23, 2017 13:38
Force case sensitivity in webpack
/*
The MIT License (MIT)
Copyright (c) 2015 Alexandre Kirszenberg
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTI
@derjohng
derjohng / xcode_ramdisk.sh
Last active June 6, 2022 03:36 — forked from skeeet/xcode_ramdisk.sh
Create a RAM disk for using with XCode, with Umount disks method
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
#import <UIKit/UIKit.h>
@interface UILabel (AutoResizeingFix)
@end
@dlo
dlo / Auto-layout-keyboard-adjustment.md
Last active February 26, 2021 07:33
How to adjust a view's height with Auto Layout when a keyboard appears or disappears in iOS 7.

This gist outlines how to resize a view when a keyboard appears using Auto Layout (there are a bunch of code samples out there that manually adjust the view's frame, but that's just so 2013). The method I outline below works universally on both iPhone and iPad, portrait and landscape, and is pretty darn simple.

Setting Up

The first thing to do is to define our containing view controller, the view, and the bottom constraint that we'll use to adjust its size.

Here's HeightAdjustingViewController.h. We don't need to expose any public properties, so it's pretty bare.

#!/bin/bash
echo '#!/bin/bash'
echo ''
echo 'failed_items=""'
echo 'function install_package() {'
echo 'echo EXECUTING: brew install $1 $2'
echo 'brew install $1 $2'
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.'
echo '}'
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: