Skip to content

Instantly share code, notes, and snippets.

View niedbalski's full-sized avatar
Be humble and stay focused

Jorge Niedbalski niedbalski

Be humble and stay focused
View GitHub Profile
@niedbalski
niedbalski / rubberduck.js
Created October 28, 2013 21:29
Rubberduck a compact javascript MVC framework (Work in progress)
// R framework a minimal mvc framework to
// solve common javascript problems
//
// @author: Jorge Niedbalski R. <[email protected]>
// @license: MIT
(function() {
r = {};
r.app = function(options) {
$.extend(this, $.Deferred(), options || {});
var self = this;
@niedbalski
niedbalski / app.js
Created October 29, 2013 20:26
R: a minimalist JS MVC for people with family.
<!Doctype html>
<html>
<head>
<!-- This is the R framework -->
<script type="text/javascript" src="./r.js"></script>
<script>
$(document).ready(function() {
var app = new r.app({
name: 'TodoApp',
#!/usr/bin/env python
# Jorge Niedbalski <[email protected]>
class Query:
(c,d) = ([],[])
def __init__(self):
pass
def a(self, d):
#
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
#
# This is a low-hanging-fruit type of VCL. TTL of objects are overridden to 2
# minutes, and everything below /ghost/ is pass()-ed so the user sessions
# work.
#
@niedbalski
niedbalski / default-openshift-ghost.vcl
Created November 22, 2013 18:02
Proxy varnish ghost blog engine on redhat openshift
backend default {
.host = "app.rhcloud.com";
.port = "80";
}
sub vcl_recv {
set req.http.host = "app.rhcloud.com";
if (req.http.cache-control ~ "no-cache") {
@niedbalski
niedbalski / default.vcl
Created December 20, 2013 20:07
Purge a varnish cache from ghost patch :)
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
backend default {
.host = "blog-jniedbalski.rhcloud.com";
.port = "80";
@niedbalski
niedbalski / spf.py
Last active August 29, 2015 13:56
chess-solver.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import networkx as nx
import matplotlib.pyplot as plt
__author__ = 'Jorge Niedbalski R. <[email protected]>'
class SPF:
valid_moves = [(-1, -2),
@niedbalski
niedbalski / python-fstab.py
Created May 22, 2014 21:56
python-fstab.py
class Fstab(file):
class Entry(object):
def __init__(self, device, mountpoint, filesystem,
options, d=0, p=0):
self.device = device
self.mountpoint = mountpoint
self.filesystem = filesystem
=== modified file 'deployer/action/importer.py'
--- deployer/action/importer.py 2014-05-29 17:03:15 +0000
+++ deployer/action/importer.py 2014-05-29 20:45:52 +0000
@@ -60,7 +60,7 @@
self.log.debug("Getting charms...")
self.deployment.fetch_charms(
update=self.options.update_charms,
- no_local_mods=self.options.no_local_mods)
+ local_mods=self.options.local_mods)
=== modified file 'charmtools/templates/python/files/scripts/charm_helpers_sync.py'
--- charmtools/templates/python/files/scripts/charm_helpers_sync.py 2014-05-23 20:10:24 +0000
+++ charmtools/templates/python/files/scripts/charm_helpers_sync.py 2014-05-30 20:19:55 +0000
@@ -30,7 +30,7 @@
def clone_helpers(work_dir, branch):
dest = os.path.join(work_dir, 'charm-helpers')
logging.info('Checking out %s to %s.' % (branch, dest))
- cmd = ['bzr', 'branch', branch, dest]
+ cmd = ['bzr', 'checkout', '--lightweight', branch, dest]
subprocess.check_call(cmd)