Skip to content

Instantly share code, notes, and snippets.


Operations Research Engineering Software+ ORESoftware

Block or report user

Report or block ORESoftware

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
ORESoftware /
Created May 21, 2019
push event payload from Bitbucket API

Here is a sample push payload from bitbucket API:

    "push": {
      "changes": [
          "forced": false,
          "old": {
ORESoftware /
Created May 18, 2019
Removing old unneeded commits - saving disk space and making git clones faster

Say my git repo has 5,000 commits, how can I remove the first 4,000 commits that are quite old and no longer needed, in order to save disk space?

by Sebass van Boxel, Solutions Engineer at GitHub (2018-present)

First of all, I would try less destructive ways to clean up disk space in your git project. If you're collaborating on a repository with others, it's considered a bad practice to rewrite published history. If you’ve already decided that this is what you want to do, please skip the first part. One of the great powers of Git is that it preserves all history. Often you only realize that you really needed that history when it isn’t there anymore. For new people that join your project, it can be of great value to know what happened for what reason, by “removing” those old commits, they'll lose that context. My advice, before anything else, would be to run Git’s built-in housekeeping task:

ORESoftware / promises-in-series.js
Last active May 7, 2019
Run promises in series with an initial value
View promises-in-series.js
// promises are wrapped in a function - known as "promise-providers"
const providers = [
return Promise.resolve(v+1);
ORESoftware / my.Dockerfile
Created May 3, 2019
caching steps using git pull
View my.Dockerfile
RUN git clone x
RUN git pull
RUN npm install
# the problem is that npm install will always run
# but we can do this instead
ORESoftware / apache.conf
Created Apr 30, 2019
Default apache conf contents
View apache.conf
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:> for detailed information.
# In particular, see
# <URL:>
# for a discussion of each configuration directive.
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
ORESoftware / bfs.js
Last active Apr 12, 2019
Simple breadth first traversal example
View bfs.js
'use strict';
const queue = [];
const root = {};
const main = {
name: 'main',
a: {
name: 'a',
ORESoftware /
Last active Mar 19, 2019
Python swallows an error

Run this container (it's a server):

docker run -p 6970:6970 -it oresoftware/live-mutex-broker:latest

then run this python script with Python 3.6.7:

ORESoftware / promises.ts
Last active Mar 11, 2019
promise api technique
View promises.ts
export class Worker {
getLock(v: string, cb: Function){
return new Promise((resolve,reject) => {
this.getLockInternal(v, (err,result) => {
ORESoftware /
Last active Feb 28, 2019
Standard way to tell XML parsers that child is a singleton as opposed to a list

Say we have this XML

  <book>art of war</book>

Most bookstores have many books, so we'd probably be right to assume that books is a list.

View null.9.ts
const passAStringOrNull = (v: StringOrNull) => {
let input: String;
if(v == null){
input = "default string";
else {
input = v;
return goDoDatabaseStuff(input);
You can’t perform that action at this time.