Skip to content

Instantly share code, notes, and snippets.

View passy's full-sized avatar
😷
Wear a mask.

Pascal Hartig passy

😷
Wear a mask.
View GitHub Profile
@passy
passy / yeoman_compass.md
Last active January 7, 2016 19:24
Using Yeoman with Compass Sprites

Yeoman + Compass Sprites

Setup

generator-webapp has support for compass out of the box. However, in order to use one of my favorite features of it — sprites and the image_url helper — you have to make some adjustments to the Gruntfile.

Let's assume you use a SASS stylesheet like this one:

@import "design/*.png"
@passy
passy / gist:8652275
Last active January 4, 2016 17:09 — forked from ahume/gist:8648977
// What about this as a compromise?
function test() {
page.loadAndWaitForSignInUi()
.then(page.setViewportSize.bind(page, 1300, 500);
.then(page.patchStreamScribe.bind(page))
.then(page.login.bind(page, account.creds));
}
<?
if ( ((!$_GET['info']) || (@$_GET['info'] == $whos_online['session_id'])) && (!$info) ) {
$info = $whos_online['session_id'];
}
else if(!empty($_GET['info'])) $info = $_GET['info'];
...
$session_data = xtc_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $info . "'");
@passy
passy / extract.js
Last active December 18, 2015 20:49
Extract the argument initConfig in a Gruntfile is called with.
'use strict';
var falafel = require('falafel');
var fs = require('fs');
var src = fs.readFileSync('Gruntfile.js', { encoding: 'utf-8' });
falafel(src, function (node) {
if (node.type === 'CallExpression' &&
node.callee.type === 'MemberExpression' &&
@passy
passy / check_learn.py
Created June 19, 2013 09:35
Check the learn.json for bad links
#!/usr/bin/env python
import json
import sys
import grequests
def find_urls(file):
urls = []
diff --git a/autoload/smartinput.vim b/autoload/smartinput.vim
index 15a9363..9b71f18 100644
--- a/autoload/smartinput.vim
+++ b/autoload/smartinput.vim
@@ -73,7 +73,7 @@ function! smartinput#define_default_rules() "{{{2
endfunction
call urules.add('()', [
\ {'at': '\%#', 'char': '(', 'input': '()<Left>'},
- \ {'at': '\%#\_s*)', 'char': ')', 'input': '<C-r>=smartinput#_leave_block('')'')<Enter><Right>'},
+ \ {'at': '\%#\s*)', 'char': ')', 'input': '<C-r>=smartinput#_leave_block('')'')<Enter><Right>'},
@passy
passy / pure.js
Last active December 18, 2015 02:18
'use strict';
var util = require('util');
var yeoman = require('yeoman-generator');
var Generator = module.exports = function Generator() {
yeoman.generators.Base.apply(this, arguments);
};
$ jshint labs/architecture-examples/ariatemplates/ | grep -v 'lib/' | cb
labs/architecture-examples/ariatemplates/js/ITodoCtrl.js: line 9, col 28, Missing space after 'function'.
labs/architecture-examples/ariatemplates/js/ITodoCtrl.js: line 10, col 26, Missing space after 'function'.
labs/architecture-examples/ariatemplates/js/ITodoCtrl.js: line 11, col 29, Missing space after 'function'.
labs/architecture-examples/ariatemplates/js/ITodoCtrl.js: line 4, col 1, 'Aria' is not defined.
labs/architecture-examples/ariatemplates/js/ITodoCtrl.js: line 10, col 38, 'description' is defined but never used.
labs/architecture-examples/ariatemplates/js/ITodoCtrl.js: line 11, col 33, 'idx' is defined but never used.
labs/architecture-examples/ariatemplates/js/view/TodoScript.js: line 9, col 29, Missing space after 'function'.
labs/architecture-examples/ariatemplates/js/view/TodoScript.js: line 18, col 29, Missing space after 'function'.
diff --git a/traq_helper.sh b/traq_helper.sh
index 58e132b..237f6fb 100644
--- a/traq_helper.sh
+++ b/traq_helper.sh
@@ -2,6 +2,18 @@
. $TRAQ_PATH/os_helper.sh
+if [ `is_osx` ]
+then
@passy
passy / 469-yeoman-modrewrite.patch
Created September 30, 2012 19:27
yeoman 0.9.2 modrewrite support
commit 5a442b3b62cb1f1c196ad41b80e040785dd006b8
Author: Pascal Hartig <phartig@rdrei.net>
Date: Sun Sep 30 21:26:23 2012 +0200
Updated modrewrite patch for yeoman 0.9.2
diff --git a/cli/tasks/server.js b/cli/tasks/server.js
index 554bb5e..4dd1e65 100644
--- a/cli/tasks/server.js
+++ b/cli/tasks/server.js