Skip to content

Instantly share code, notes, and snippets.

View IndigoW0lf's full-sized avatar
:electron:
Always Learning

Kai Wolf IndigoW0lf

:electron:
Always Learning
View GitHub Profile
@IndigoW0lf
IndigoW0lf / postgres-cheatsheet.md
Created October 1, 2023 16:34 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@IndigoW0lf
IndigoW0lf / get_barcode_from_image.js
Created August 9, 2022 22:47 — forked from tobitailor/get_barcode_from_image.js
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@IndigoW0lf
IndigoW0lf / regexCheatsheet.js
Created August 9, 2022 22:47 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@IndigoW0lf
IndigoW0lf / .eslintrc.js
Created August 9, 2022 22:47 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@IndigoW0lf
IndigoW0lf / LICENSE.txt
Created August 9, 2022 22:47 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@IndigoW0lf
IndigoW0lf / javascript timer
Created August 9, 2022 22:43
timer script using javascript
<script>
function pretty_time_string(num) {
return ( num < 10 ? "0" : "" ) + num;
}
var start = new Date;
setInterval(function() {
var total_seconds = (new Date - start) / 1000;
function foo(x) { x = (typeof x != "undefined") ? x : 10; .. }
function foo(x = 10) { .. }
function foo(x,y,z) { .. }; foo.apply(null,[1,2,3]);
function foo(x,y,z) { .. }; foo(...[1,2,3]);
function foo() { var args = [].slice.call(arguments); .. }
function foo(...args) { .. }
var o = { x: 2, y: 3 }, x = o.x, y = o.y, z = (typeof o.z != "undefined") ? o.z : 10;

{ TODO - PROJECT NAME HERE}

Duration: { TODO - Note the time spent/planned for this project }

{ TODO - If your project is deployed somewhere, add a link to it. Also add a link next to the GitHub description. Otherwise, remove the text below.}

To view this application live, please visit: PROJECT NAME HERE

Description

import numpy as np
import matplotlib.pyplot as plt
SELECT
CASE
WHEN A + B <= C or A + C <= B or B + C <= A THEN 'Not A Triangle'
WHEN A = B and B = C THEN 'Equilateral'
WHEN A = B or A = C or B = C THEN 'Isosceles'
WHEN A != B and B != C THEN 'Scalene'
END tuple
FROM TRIANGLES;
Write a query identifying the type of each record in the TRIANGLES table using