This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
git rebase --interactive HEAD~2 | |
# we are going to squash c into b | |
pick b76d157 b | |
pick a931ac7 c | |
# squash c into b | |
pick b76d157 b | |
s a931ac7 c |
git_branch() { | |
local branch=$(git --no-optional-locks branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/^* (*\([^)]*\))*/\1/') | |
if [[ -n $branch ]]; then | |
if [[ -z $(git --no-optional-locks status --porcelain 2> /dev/null) ]]; then | |
echo -e " \001\033[32m\002($branch)\001\033[0m\002" | |
else | |
echo -e " \001\033[31m\002($branch)\001\033[0m\002" | |
fi | |
fi |
'use strict'; | |
var morgan = require('morgan'); | |
var os = require('os'); | |
morgan.token('conversation-id', function getConversationId(req) { | |
return req.conversationId; | |
}); | |
morgan.token('session-id', function getSessionId(req) { | |
return req.sessionId; |
<html> | |
<head> | |
<style> | |
#header{ | |
background-color: lightblue; | |
width:100%; | |
height:50px; | |
text-align: center; | |
} |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
#!/usr/bin/env python | |
# Haversine formula example in Python | |
# Author: Wayne Dyck | |
import math | |
def distance(origin, destination): | |
lat1, lon1 = origin | |
lat2, lon2 = destination |
MIT License | |
Copyright © 2019 Andrés Zorro | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
/** | |
* CSS Inline Transform v0.1 | |
* http://tikku.com/css-inline-transformer-simplified | |
* | |
* Copyright 2010-2012, Nirvana Tikku | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt | |
* | |
* This tool leverages the jQuery library. | |
* |
// Credit to @steobrien from https://gist.github.com/rmehner/b9a41d9f659c9b1c3340#gistcomment-2940034 | |
// for modern browsers, this works: | |
const dbs = await window.indexedDB.databases() | |
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) }) | |
// for older browsers, have a look at previous revisions of this gist. |