Skip to content

Instantly share code, notes, and snippets.

View topless's full-sized avatar
💭
Music For The Jilted Generation

Christos Topaloudis topless

💭
Music For The Jilted Generation
View GitHub Profile
@topless
topless / jsbin.bepifebe.html
Last active August 29, 2015 13:56
Webpage Beta ribbon
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Ribbon" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="ribbon-wrapper-green">
<div class="ribbon-green">
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
@topless
topless / gae-date-query.py
Last active October 19, 2016 13:24
Query entities from a specific date and forth.
# https://github.com/gae-init/gae-init, for the rest of the functions
import datetime
def entities_from_date():
cursor = {'prev': None, 'next': None}
test_date = datetime.datetime.now() - datetime.timedelta(days=2)
entity_dbs_qry = model.Entity.query(model.Entity.created >= test_date)
entity_dbs = entity_dbs_qry.order(-model.Run.created).fetch()
@topless
topless / blobstore_api_upload.py
Created January 26, 2016 22:06
Flask example to upload to with google appengine blobstore api.
# coding: utf-8
from __future__ import absolute_import
from google.appengine.ext import ndb
from google.appengine.ext import blobstore
import cloudstorage as gcs
import flask
from flask.ext import restful
@topless
topless / gae-queue-patch-all-entities.py
Last active April 21, 2016 12:25
Deferred app engine queue, to iterate though all entities.
@api_v1.resource('/run/patch', endpoint='api.run.patch')
class PatchRunAPI(restful.Resource):
def get(self):
deferred.defer(update_run_task)
return flask.jsonify({
'result': 'The queues started patching all run models!!',
'status': 'success',
})
@topless
topless / foo_list.py
Last active July 4, 2016 11:28
gae-init rest api arguments as query params.
# Parsing request arguments and passing them to our db query with validation ;)
@api_v1.resource('/foo/', endpoint='api.foo.list')
class FooListAPI(restful.Resource):
def get(self):
args = parser.parse({
'name': wf.Str(missing=None),
'limit': wf.Int(missing=config.DEFAULT_DB_LIMIT),
'order': wf.Str(missing='-created')
})
@topless
topless / pr.md
Created October 8, 2018 15:06 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@topless
topless / on-jsx.markdown
Created November 5, 2018 01:32 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@topless
topless / ils.yml
Last active December 2, 2019 17:08
itermocil
windows:
- name: invenio-app-ils
root: ~/Work/invenio-app-ils
layout: even-vertical
panes:
- docker-compose up
- celery worker -A invenio_app.celery -l INFO
- commands:
- workon ils
- code .