Skip to content

Instantly share code, notes, and snippets.

View gjbagrowski's full-sized avatar

Grzegorz Bagrowski gjbagrowski

View GitHub Profile
Preferences.sublime-settings:
{
// colors
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"theme": "Soda Dark.sublime-theme",
"caret_style": "wide",
"font_size": 9,
"highlight_line": true,
"highlight_modified_tabs": true,
"margin": 0,
@gjbagrowski
gjbagrowski / Knight rider
Created March 30, 2014 22:35
Knight rider leds, spark core version.
int leds[] = {D4, D3, D2, D1, D0};
int led_count = 5;
int timer = 15;
void setup() {
for (int i = 0; i < led_count; i++) {
pinMode(leds[i], OUTPUT);
}
}
@gjbagrowski
gjbagrowski / gist:5b269e282e9322865705
Last active August 29, 2015 13:59
Sublime text 3 config
{
"anaconda_linter_mark_style": "outline",
"auto_complete_commit_on_tab": true,
"auto_complete_triggers":
[
{
"characters": ".",
"selector": "source.python - string - comment - constant.numeric"
}
],
@gjbagrowski
gjbagrowski / gist:10836822
Last active August 29, 2015 13:59
Nevar forget
# object instances as default arguments are evil
def nevar_forget(constarg={}):
constarg[len(constarg)] = 'the catch'
print(constarg)
return constarg
assert(nevar_forget() == {0: 'the catch'})
assert(nevar_forget() == {0: 'the catch', 1: 'the catch'})
assert(nevar_forget() == {0: 'the catch', 1: 'the catch', 2: 'the catch'})
ActionBar = React.createClass
mixins: [
React.BackboneMixin("actions")
]
render: ->
<ul className="nav navbar-nav">
<li className="dropdown">
<a className="dropdown-toggle" data-toggle="dropdown" href='#'>
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from six import string_types, integer_types
from itertools import chain
class EnumMetaclass(type):
"""Metaclass for enumerations.
MainView = React.createClass
mixins: [RouterHelpersMixin]
render: ->
<body>
<NavbarView
actions={@props.models.actions}
filters={@props.models.navbarFilters}
define [
'common', 'underscore', 'react', 'backbone'
], (
common, _, React, Backbone,
) ->
R = React.DOM
Brand = React.createClass
Backbone = require('backbone')
React = require('react')
_ = require('underscore')
{settings} = require('../../common.coffee')
radio = require('../../controllers/radio.coffee')
Brand = React.createClass
render: ->
/** @jsx React.DOM */
var BootstrapModalMixin = function() {
var handlerProps =
['handleShow', 'handleShown', 'handleHide', 'handleHidden']
var bsModalEvents = {
handleShow: 'show.bs.modal'
, handleShown: 'shown.bs.modal'
, handleHide: 'hide.bs.modal'