Skip to content

Instantly share code, notes, and snippets.

Stephen Parish stephenparish

Block or report user

Report or block stephenparish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stephenparish /
Last active Dec 15, 2015
An easy to enable or disable view pager for Android
public class StoppableViewPager extends ViewPager {
private boolean mEnabled;
public StoppableViewPager(Context context) {
mEnabled = true;
public StoppableViewPager(Context context, AttributeSet attrs) {
stephenparish /
Created Feb 9, 2012
SVN Partial Checkout
# checkout only immediate folders for a partial checkout
svn co http://subversion/project/trunk my_checkout --depth immediates
# change the depth and update
svn update --set-depth infinity
# another example
svn checkout --depth empty http://svnserver/trunk/ proj
svn update --set-depth infinity proj/foo
stephenparish / noisy.js
Created Jan 31, 2012
Add a noise background to your site: Currently working for better non-grayscale support
View noisy.js
function addNoise(canvas) {
var ctx = canvas.getContext('2d');
// get canvas pixels
var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
var pixels =;
for (var i = 0, il = pixels.length; i < il; i += 4) {
// var color = Math.round(Math.random() * 255);
var M = 100;
stephenparish / gist:1349792
Created Nov 9, 2011
Less.js CSS Functions, some common short-hands I use to make my life easier.
View gist:1349792
// add rounded corners to an item
.border-radius (@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
// add only specific rounded corners
.border-radius-all (@top: 5px, @right: 5px, @bottom: 5px, @left: 5px) {
-webkit-border-radius: @arguments;
stephenparish /
Created Nov 9, 2011
Remove All SVN Folders -- When I have to clean up an old SVN checkout, I use this to remove the junk.
echo "Recursively removing .svn folders from"
rm -rf `find . -type d -name .svn`
echo "Folders removed."
View index.html
<div id="test-result"></div>
View ie8scale.css
.scaleIt {
-webkit-transform: scale(0.5); /* Saf3.1+, Chrome */
-moz-transform: scale(0.5); /* FF3.5+ */
-ms-transform: scale(0.5); /* IE9 */
-o-transform: scale(0.5); /* Opera 10.5+ */
transform: scale(0.5); /* IE8+ - must be on one line, unfortunately */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.5, M12=0, M21=0, M22=0.5, SizingMethod='auto expand')";
/* IE6 and 7 */
filter: progid:DXImageTransform.Microsoft.Matrix(
You can’t perform that action at this time.