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 / 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 = [email protected]: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 / 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 / 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 / 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-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()
'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 / 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">