Skip to content

Instantly share code, notes, and snippets.

Alex Michael alexmic

Block or report user

Report or block alexmic

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 gist:d18909eae43a5ad053c8ed754c7771ef
### Keybase proof
I hereby claim:
* I am alexmic on github.
* I am alexmic (https://keybase.io/alexmic) on keybase.
* I have a public key ASBJlx8-MALgeEzpRMR4ItUwCq1N2t9rvwH706qs8ZJmpwo
To claim this, I am signing this object:
@alexmic
alexmic / example.py
Last active Aug 29, 2015
Sketch for how I'd like a simple REST service framework to work
View example.py
from swiss import Api
from swiss.resources import Resource, Group
from swiss.auth import BasicAuth, noauth
from swiss.fields import parse, serialize, parselize
from swiss.fields import String, Int, Boolean
# simple dicts for schemas and serialization
schema = {
'name': String,
@alexmic
alexmic / pixel_count.py
Last active Jan 2, 2016
Counts the number of pixels per letter of the English alphabet.
View pixel_count.py
from operator import itemgetter
from PIL import Image, ImageDraw, ImageFont
# Make a lowercase + uppercase alphabet.
alphabet = 'abcdefghijklmnopqrstuvwxyz'
alphabet += ''.join(map(str.upper, alphabet))
# We'll use Helvetica in big type.
@alexmic
alexmic / data.json
Last active Dec 31, 2015
Microtemplates example, read from JSON file.
View data.json
{
"webpage": {
"title": "Stackoverflow"
},
"cover_artists": [
{
"name": "Ozzy",
"nicknames": ["Ozzman", "Ozzster"]
},
{
View conftest.py
import os
import pytest
from alembic.command import upgrade
from alembic.config import Config
from project.factory import create_app
from project.database import db as _db
View pytest_demo.py
"""
py.test demo
~~~~~~~~~~~~
#yolo
"""
from pytest import raises, mark, fixture
@alexmic
alexmic / problem_79.py
Created Oct 5, 2013
Project Euler problem #79.
View problem_79.py
from collections import defaultdict, deque
def find_number_universe(keylog):
numbers = set()
for attempt in keylog:
for num in attempt:
numbers.add(num)
return numbers
@alexmic
alexmic / directives.js
Created Jul 4, 2013
File select in angular.js.
View directives.js
angular.module('webApp.directives', [])
// user as file-select="image"
.directive('fileSelect', ['$q', function($q) {
return function($scope, $elem, attrs) {
var openFileInput = function() {
// gets or creates an input on the DOM.
var id = '__global_file_input'
, html = '<input type="file" id="' + id + '" style="display:none" />'
, input = angular.element('#' + id)
View hackcyprus.md

What is Hack Cyprus

Hack Cyprus aspires to start a much-lacking innovation wave in Cyprus by bringing programmers, designers and technologists together. It is mainly represented by a Facebook group with ~400 members which ignites interesting discussions around technology on a daily basis and serves as a mechanism for people to find talent or projects to work on.

Hackathons

Hackathons are a central part of the culture embodied in Hack Cyprus. We believe that such events are ideal for creating environments where ideation and creation can thrive. Our first hackathon, and indeed the first ever in Cyprus, took place in September 2012 at the Cyprus University of Technology. The event amassed more than 70 participants with more than 10 teams presenting their projects in the end. Given the current situation with technology in Cyprus, we consider this to be a big win.

View gist:4964806
Avocarrot.config({
auth: 'api_key',
api_key: '1234'
});
Avocarrot.getRandomReward(function(err, reward) {
// todo
});
You can’t perform that action at this time.