Skip to content

Instantly share code, notes, and snippets.

View michal's full-sized avatar

Michał Maliszewski michal

View GitHub Profile
backgroundOrder:
- 11
- 13
- 44
- 52
- 51
- 50
- 9
- 12
- 14
@michal
michal / entity.js
Created March 11, 2016 15:18
bacbone like models with pubsub
import _ from 'lodash'
import Events from './events'
export default class Entity {
constructor(defaults) {
this.$events = new Events()
this.$original = {}
this.$changed = []
this._attributes = {}
{
"httpRoot": "/",
"httpPort": 8080,
"serviceRoot": "/api/",
"serviceHost": "localhost",
"useLocal": true,
"staticPath": ["apps", "library"]
}
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=/home/huncwot/domains/reserved-ecomerce-master/current checkout -f $branch
package="/home/huncwot/domains/reserved-ecomerce-master/current/packages/${newrev}.zip"
git archive --format=zip HEAD skin templates > $package
var Proxy = {
create: function(module, key) {
return {
// dodajemy obietnice
promise: function(event) {
var def = $.Deferred();
event.data.resolve = def.resolve;
module.triggerEvent(event);
return def.promise();
},
@michal
michal / group.tmsnippet
Created August 1, 2011 13:00
textmate css group snippet
/* @group ${1:name} */
${0:$TM_SELECTED_TEXT}
/* @end ${1:name} */
@michal
michal / css.tmlanguage
Created August 1, 2011 12:58
textmate css language
{ scopeName = 'source.css';
comment = '';
fileTypes = ( 'css', 'css.erb' );
foldingStartMarker = '/\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S))|\/\*\s*@group\s*.*\s*\*\/';
foldingStopMarker = '(?<!\*)\*\*/|^\s*\}|\/*\s*@end\s*.*\s*\*\/';
patterns = (
{ include = '#comment-block'; },
{ include = '#selector'; },
{ name = 'meta.at-rule.charset.css';
begin = '\s*((@)charset\b)\s*';
@michal
michal / .bash_profile
Created July 7, 2011 19:37
My bash profile
PATH=/usr/local/bin:/usr/local/sbin:$PATH
source `brew --prefix`/Library/Contributions/brew_bash_completion.sh
export EDITOR=/usr/local/bin/mate
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export CLICOLOR=1
@michal
michal / css-group.tmbundle
Created March 6, 2011 18:53
folding group syntax and snippet
foldingStartMarker = '/\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S))|\/\*\s*@group\s*.*\s*\*\/';
foldingStopMarker = '(?<!\*)\*\*/|^\s*\}|\/*\s*@end\s*.*\s*\*\/';
/* @group ${1:name} */
${0:$TM_SELECTED_TEXT}
/* @end ${1:name} */
<?php
class Endo_Filter_Typografic implements Zend_Filter_Interface
{
public function filter($value)
{
$value = preg_replace('/(\s([\w]{1})\s)/u', ' ${2}&nbsp;', $value);
return $value;
}
}