This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# tmux session initialisation script | |
# change the following config to your preferences | |
SESSION="work" | |
workspace1="$HOME/server/www" | |
workspace2="$HOME/codeyard" | |
tmux has-session -t $SESSION > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Timer; | |
Timer = (function() { | |
function Timer(opts) { | |
this.opts = opts != null ? opts : {}; | |
_(this).extend(Backbone.Events); | |
_.defaults(this.opts, { | |
start: 0 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IntegrationLevel(db.Model): | |
__tablename__ = 'integration_levels' | |
id = db.Column(db.Integer, primary_key=True) | |
level = db.Column(db.Integer, nullable=False) | |
labs = db.relationship('Lab', backref='integration_level') | |
class TypeOfLab(db.Model): | |
__tablename__ = 'type_of_labs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf8 -*- | |
# Some limey functions! | |
from functools import reduce | |
import itertools | |
import unittest | |
def omit(x, li): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Control.Monad.Except | |
import Control.Monad.IO.Class () | |
import Control.Monad.Reader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE author ( | |
id INTEGER PRIMARY KEY, | |
name TEXT | |
); | |
CREATE TABLE article ( | |
id INTEGER PRIMARY KEY, | |
title TEXT, | |
content TEXT, | |
author_id INTEGER, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update_author( | |
_inc: author_inc_input | |
_set: author_set_input | |
where: author_bool_exp! | |
): author_mutation_response | |
author_set_input { | |
id: Int | |
name: String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation update_title_content { | |
update_article( | |
where: {id: {_eq: 1}}, | |
_set: { | |
title: "John's new first post title", | |
content: "New content for John's first post" | |
} | |
) { | |
affected_rows | |
returning { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation update_likes { | |
update_article( | |
where: {id: {_eq: 1}}, | |
_inc: {likes: 1} | |
) { | |
affected_rows | |
returning { | |
id | |
likes | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation update_drafts { | |
update_article( | |
where: {author: {name: {_eq: "John"}}}, | |
_set: {is_published: true} | |
) { | |
affected_rows | |
} | |
} |
OlderNewer