Skip to content

Instantly share code, notes, and snippets.

View redhotvengeance's full-sized avatar

Ian Lollar redhotvengeance

View GitHub Profile

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@Isaddo
Isaddo / import-github-labels.js
Last active February 9, 2024 22:44
import github labels via console command
/*
Go on your labels page (https://github.com/user/repo/labels)
Edit the following label array
or
Use this snippet to export github labels (https://gist.github.com/MoOx/93c2853fee760f42d97f)
and replace it
Paste this script in your console
Press Enter!!
@staltz
staltz / migration-guide.md
Last active December 19, 2023 22:14
How to show migration guides in GitHub Markdown

How to show migration guides in GitHub Markdown

Use the diff code highlighting tag.

  ```diff
  - foo
  + bar

Example:

@MoOx
MoOx / index.js
Last active February 9, 2024 22:44
Export/import github labels
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),
@tmodrzynski
tmodrzynski / ndb-properties-migration.md
Last active April 5, 2017 06:27
ndb.Model - migrating properties like a boss

ndb.Model - migrating properties like a boss

The problem

Consider following model:

class X(ndb.Model):
    prop1 = ndb.StringProperty()
    prop2 = ndb.StringProperty()
@jashkenas
jashkenas / semantic-pedantic.md
Last active November 29, 2023 14:49
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

@staltz
staltz / introrx.md
Last active March 26, 2024 00:52
The introduction to Reactive Programming you've been missing
/*
Swift Programming Language Guide
"A Swift Tour" Solutions
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-XID_1
These are the solutions to all the "experiments" in the pre-release Swift Programming Guide
(released on the same day Apple announced Swift). A couple of things worth noting:
1. Swift syntax, e.g. array declarations, has changed since I releasd these. So this code will
probably cause some errors when you paste it into a playground. Should be easy enough to fix
@jeremydw
jeremydw / google-app-engine-environment.textile
Last active April 8, 2018 13:19
Google App Engine Environment Variables (as of Google App Engine/1.8.6, October 2013)
APPENGINE_RUNTIME python27
APPLICATION_ID s~appid
AUTH_DOMAIN gmail.com
CONTENT_LENGTH 148
CONTENT_TYPE application/x-www-form-urlencoded
CURRENT_MODULE_ID default
CURRENT_VERSION_ID appid.370290628632119235
DATACENTER us1
DEFAULT_VERSION_HOSTNAME appid.appspot.com
HTTPS on
@claystreet
claystreet / dynamic_property.py
Last active January 3, 2017 21:45
Google App Engine (GAE) helper for python.... create dynamic properties of any basic type (except ndb.StructuredProperty). Include as a mixin in any ndb.Expando or ndb.Model derived class. class MyModel(ndb.Model, DynamicPropertyMixin): pass Then... at any point where you have a MyModel entity you can create a dynamic property: my = MyModel() my…
from google.appengine.ext import ndb
class DynamicPropertyMixin(object):
""" Facilitates creating dynamic properties on ndb.Expando entities.
Also works on ndb.Model derived classes!
Note: keyword args are passed on to the underlying ndb.XxxProperty() class
"""
def is_prop(self, name):