Skip to content

Instantly share code, notes, and snippets.

View mfellner's full-sized avatar
🤖

Maximilian Fellner mfellner

🤖
View GitHub Profile
@mfellner
mfellner / rsync-sshfs.sh
Created June 9, 2013 15:42
Sync a local and a remote directory with rsync over sshfs (e.g. when you only have sftp access). Note the defer_permissions option and the -c (checksum) flag. Tested on OS X with rsync 2.6.9 and sshfs 2.4.0 (fuse4x 0.9.2).
#!/bin/bash
SSH_USER="[email protected]" # your sftp credentials
SSH_KEY="~/.ssh/id_rsa" # your ssh private key
DOCUMENT_ROOT="/www/vhosts/mywebsite.com/htdocs" # directory on the remote server
LOCAL_DIR="~/mywebsite.com/public" # directory on your local machine
REMOTE_DIR="_remote_dir" # temporary mount point
mkdir -p $REMOTE_DIR
sshfs $SSH_USER:$DOCUMENT_ROOT $REMOTE_DIR -o workaround=rename -o defer_permissions -o IdentityFile=$SSH_KEY
@mfellner
mfellner / get-cucumber-jvm.sh
Created July 1, 2013 18:43
Bash script to download cucumber-jvm, the Android module and dependencies.
#!/bin/sh
REPO_ROOT=https://oss.sonatype.org/content/repositories
RELEASE=/releases
SNAPSHOT=/snapshots
CUCUMBER=/info/cukes
META=/maven-metadata.xml
V_LATEST_TAG=latest
V_LAST_TAG=version
# MODULES
MODULES[0]=/gherkin
@mfellner
mfellner / rjs.py
Created February 13, 2014 16:20
r.js (require.js) filter for Python webassets (https://github.com/miracle2k/webassets)
# -*- coding: utf-8 -*-
from ntpath import basename, dirname
from webassets.filter import ExternalTool
__all__ = ('RJS',)
class RJS(ExternalTool):
"""Uses r.js from `RequireJS <http://requirejs.org/>`_ to optimize JavaScript files.

Keybase proof

I hereby claim:

  • I am mfellner on github.
  • I am maxf (https://keybase.io/maxf) on keybase.
  • I have a public key whose fingerprint is 0FD5 DB75 2F5F DC39 186E 0AA0 4337 D241 92E9 A47F

To claim this, I am signing this object:

@mfellner
mfellner / index.html
Created November 19, 2014 10:41
AWS S3 Index
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<table id="table">
<tbody>
<tr>
@mfellner
mfellner / main.es6
Last active August 3, 2017 04:32
Playing with RxJS Observables and ES6
const Rx = require('Rx');
require('babel/register');
const Observables = require('./observables.es6');
// Define a very simple, router-like object
class Router {
constructor() {
this.routes = {};
}
@mfellner
mfellner / juggling-async.js
Created May 23, 2015 15:31
juggling-async.js
var http = require('http')
var bl = require('bl')
var results = []
var count = 0
function printResults () {
for (var i = 0; i < 3; i++)
console.log(results[i])
}
@mfellner
mfellner / edx-enumerate.js
Last active November 8, 2015 15:07
Enumerate answer choices on edx.org
// ==UserScript==
// @name edx-enumerate
// @source https://gist.github.com/mfellner/194b7d70b9d1a682cf37
// @downloadURL https://gist.github.com/194b7d70b9d1a682cf37.git
// @version 0.1.0
// @description Enumerate answer choices
// @author mfellner
// @include *://courses.edx.org/courses/*courseware*
// @run-at document-idle
// @grant none
@mfellner
mfellner / spring-boot-swagger.xml
Created February 26, 2016 13:25
swagger-codegen-maven-plugin with spring boot
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- ... -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@mfellner
mfellner / downgrade.sh
Created March 9, 2016 10:14
How To Downgrade Docker
docker-machine create \
--driver virtualbox \
--virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.9.1/boot2docker.iso \
docker-191
docker-machine start docker-191
eval $(docker-machine env docker-191)
brew switch docker 1.9.1_1