Skip to content

Instantly share code, notes, and snippets.

View reebalazs's full-sized avatar

Balázs Reé reebalazs

View GitHub Profile
@reebalazs
reebalazs / Gruntfile.js
Created November 24, 2013 11:00
automation liverleload in progress
var collect = require('grunt-collection-helper');
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
allThirdParty: [
collect.bower('socket.io-client').path('dist/socket.io.js'),
@reebalazs
reebalazs / json_expression.py
Created November 16, 2013 12:53
Json expression type for Chameleon
import json
from chameleon.zpt.template import (
PageTemplate,
PageTemplateFile
)
from chameleon.tales import StructureExpr
from chameleon.utils import unicode_string
from chameleon.astutil import Symbol
@reebalazs
reebalazs / gist:7498336
Created November 16, 2013 10:01
injecting json to a template
import json
@view_config(route_name='project', renderer="index.mako")
def project(request):
users = ["mahesh", "hari"]
return {
'users': json.dumps(users),
}
@reebalazs
reebalazs / gist:6466582
Created September 6, 2013 16:57
hypatia problem
systemcatalog = find_catalog(context, 'system')
q = systemcatalog['content_type'].eq('MediaFolder')
online = request.params.get('search.online')
searchprint = request.params.get('search.print')
tv = request.params.get('search.tv')
radio = request.params.get('search.radio')
catalog = find_catalog(context, 'sdidemo')
@reebalazs
reebalazs / map-for-widgets.json
Created August 15, 2013 10:26
map-for-widgets
{
"endpoint": {
"name": "deform",
"source": "/Users/ree/work/substanced/deform-play",
"target": "1.10.3"
},
"canonicalDir": "/Users/ree/work/substanced/deform-play",
"pkgMeta": {
"name": "deform",
"version": "1.10.3",
@reebalazs
reebalazs / map2.json
Created August 15, 2013 10:09
map2.json
{
"endpoint": {
"name": "deform",
"source": "/Users/ree/work/substanced/deform-play",
"target": "1.10.3"
},
"canonicalDir": "/Users/ree/work/substanced/deform-play",
"pkgMeta": {
"name": "deform",
"version": "1.10.3",
@reebalazs
reebalazs / map.json
Created August 15, 2013 09:53
map.json
{
"bootstrap": {
"source": {}
},
"jquery": {
"source": {
"scripts": "components/jquery/jquery.js"
}
},
"jquery-ui": {
@reebalazs
reebalazs / latency.sh
Last active December 18, 2015 08:38
How to simulate network latency and errors on macosx
#! /bin/sh
# --
# How to simulate network latency and errors on macosx.
#
# After this you can access the 127.0.0.10 as an alias
# to your localhost, but with a roundtrip delay.
#
# delay 150ms adds the delay to the given pipe (*)
# plr 0.05 simulates packet loss.
@reebalazs
reebalazs / component.json
Last active December 14, 2015 15:19
component.json
{
"name": "sdidev-resources",
"version": "0.1.0",
"dependencies": {
"jquery": "*",
"bootstrap": "*",
"slickgrid": "*"
},
"development": {
@reebalazs
reebalazs / buster_example.js
Created February 26, 2013 10:25
buster assert exception
buster.assert.exception(block, function (err) {
return err.message.slice(0, expected.length) == expected; // startswith
}, message);