Skip to content

Instantly share code, notes, and snippets.

Jonathan Beluch jbeluch

Block or report user

Report or block jbeluch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jbeluch on github.
  • I am jbeluch (https://keybase.io/jbeluch) on keybase.
  • I have a public key whose fingerprint is 72AF 6258 DBA4 81B9 63C3 0050 9791 7B4F 9DA0 4F4D

To claim this, I am signing this object:

View sqlhelpers.py
from sqlalchemy.sql.expression import Insert
from sqlalchemy.ext.compiler import compiles
class Upsert(Insert):
'''Compiles an upsert expression for use with mysql.
Requires a keyword arg ``upsert_fields`` which lists field names to be updated in
the ON DUPLICATE KEY UPDATE clause.
'''
View test
<html>
window.top.location.href = "http://google.com";
</html>
View boulder-hack-and-tell-round-1.md

Boulder Hack and Tell - Round 1 Summary

Thanks to all who came out to Round 1 (and especially to those who spoke)! We had four presenters (and incidentally 4 different programming languages).

Also, thanks to Viget for hosting us.

Projects

John Dennison

View iter.py
class BetterIter(object):
def __init__(self, items):
self.items = items[:]
self._max_index = len(self.items) - 1
self._index = 0
def __getitem__(self, key):
try:
return self.items[key]
View playlists.py
'''
redditmusic.resources.lib.playlists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains an xbmcswift2.Module for handling the playlists
interaction for the addon.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE.txt for more details.
'''
View pagination.py
def paginate(self, items, endpoint, is_prev=None, is_next=None,
url_args=None, finish_args=None):
url_args = url_args or {}
finish_args = finish_args or {}
is_update = True
try:
current_page = self.request.args.get('page')[0]
except TypeError:
is_update = False
current_page = 0
View xbmcswift2_playlists.py
''' Example usage
from xbmcswift2 import Plugin
import xbcmswift2_playlists
plugin = Plugin()
lists = xbmcswift2_playlists.Playlists(plugin)
@plugin.route('/')
View sync.py
#!/usr/bin/env python
'''
branches: eden, dharma, frodo-pre, eden-pre, dharma-pre, playground, master
'''
import os
import datetime
from git import Repo
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from boto.s3.bucket import Bucket
View gist:3209651
666727 5016db92c4aadeeae0d757aa666696 5016db95e4b0ceedd31751a3666694 5016db99c4aabafa0104b6cc666691 5016db9ce4b0638a81be401e666686 5016dba0e4b03d2929a1ad4f666640 5016dba384ae3ecc9e01a280666573 5016dba7e4b0638a81be4034666526 5016dbaac4aadeeae0d75922666329 5016dbad84ae3ecc9e01a3eb666263 5016dbb1c4aabafa0104b7c5666235 5016dbb5e4b0638a81be4055666165 5016dbb884ae3ecc9e01a401666124 5016dbbcc4aadeeae0d75949666060 5016dbbfc4aadeeae0d7594d665903 5016dbc2c4aabafa0104b84f665839 5016dbc6e4b03d2929a1ad73665825 5016dbc984ae3ecc9e01a455665803 5016dbcde4b03d2929a1ad77665775 5016dbd084ae3ecc9e01a5a1665742 5016dbd484ae3ecc9e01a5a4665710 5016dbd7c4aadeeae0d75978665434 5016dbdbc4aabafa0104b86a665428 5016dbdec4aadeeae0d7598e665354 5016dbe2c4aadeeae0d75992665336 5016dbe5e4b0638a81be4086664910 5016dbe984ae3ecc9e01a5d6664874 5016dbed84ae3ecc9e01a5d9664754 5016dbf0e4b0638a81be409c664662 5016dbf3e4b0ceedd3175320664594 5016dbf7e4b0ceedd3175326664582 5016dbfae4b0638a81be40b1664554 5016dbfee4b0ceedd3175329664254 5016dc01e4b0638a81be40be6
You can’t perform that action at this time.