Skip to content

Instantly share code, notes, and snippets.

View ewized's full-sized avatar

ewized

View GitHub Profile
<settings>
<profiles>
<profile>
<id>projectares</id>
<repositories>
<repository>
<id>freundtech</id>
<name>freundTech</name>
<url>https://repo.freundTech.com</url>
</repository>
@ewized
ewized / fix_id_conflict.sql
Last active February 8, 2018 01:41
Postgres Bug Fix ID Conflict
-- What we did to fix this bug,
-- https://hcmc.uvic.ca/blogs/index.php?blog=22&p=8105&more=1&c=1&tb=1&pb=1
--SELECT MAX(id) FROM pilot;
--SELECT nextval('public.pilot_id_seq');
--SELECT pg_get_serial_sequence('pilot', 'id')
--SELECT nextval('public.pilot_id_seq');
--SELECT setval('public.pilot_id_seq', 13833);
<!DOCTYPE html>
<html>
<head>
<style>
.dot {
position: absolute;
height: 10px;
width: 10px;
display: block;
background: #000;
@ewized
ewized / cors-anywhere-import.js
Last active December 1, 2019 15:22
Script that will install base_elements from the latest release version
'use strict'
// Import the script from the url
function importScript(url) {
const request = new XMLHttpRequest()
request.onload = () => eval(request.responseText)
request.open('GET', url, true)
request.send()
}
const red = (text) => ({ color: '31', text })
const green = (text) => ({ color: '32', text })
const white = (text) => ({ color: '0', text })
const color = (strings, ...args) => {
const colorize = args.map(({ color, text }) => `\x1b[${color}m${text}`)
return strings.reduce((acc, item) => `${acc}${item}${colorize.shift() ?? ''}`, '')
}
console.log(color`${red`FAIL`} ${white`foobar`} ${green`pass`}`)