Skip to content

Instantly share code, notes, and snippets.

View julianwachholz's full-sized avatar
🤓

Julian Wachholz julianwachholz

🤓
View GitHub Profile
@julianwachholz
julianwachholz / LatencyIcon.js
Created October 26, 2021 22:08
SVG latency icon using tailwind utilities
const LatencyIcon = ({ latency }) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
className="inline-block h-5 w-5 text-gray-800"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
className={
0eNrkvUtvJEmWpflXAr6o3qQFVK68c9fZgx4MUAUMumbXSCSMdHN36zA+ykhGZKDg/32MdBqpJEXFzjlqGshCbioyooxXRK/IleeR7/7np4vdw+Z2v72+/9vFzc0vn/78n6//5e7Tn//36F8f/3/by5vrH//5bvv1er17/G/3v99uPv3506/b/f3D4b/86dP1+urxP/z4xerfPn3/06ft9efN3z/92X3/E/GX/330l0b95b+O/tLLfxm+//VPnzbX99v77ebHRz/9y+9/u364utjsD5/z8tdXm8/bh6vVZre5vN9vL1e3N7vNwfbtzd3hj2+uHwt+NPinT79/+vPK6vfHOr0zZi/G9jcXN7c3+/uPBlap/ByfjcSfY8uMR8y4k2YCYMa7U1YiYKWctJJeG+lqvdutduur28ZH5eHZjG8ZyS9GLrZfTzXU2M92qNSfPh36/fXhT7ZP3f8/P7nH/7PffB73iu3h39wwKvrxP1R76kVf95vNNfbj763aF8wFKfdcUDEjIfaMuIFyZPCaI/M71zg/6cbWT5tOdA50gHUdYJgV63ZH5yk3unP1R5fw7vj427YjA+YC1+2OLkJW+r0xMW5MohP9e8fUaSe2ftt2YoY+v3Q/HxsXfL8rVsaHo0Gfc2J65xizaSe2ftt0og2YA3zPAYaNC7HbE80YL0a1K9b3nonTXmz9tu1Fjzmg2xcNGxRKty9aZLxYxL5o9j5Ih05IT/y67UlsrVL6/XE0Mtzf7NdfN6v79fUvrSXPs51y+PbP2/2PT39eLL83+jpU3G5vDxZvVl/3Nw/Xn1tm3Q+z9a3Z1DJbcbMpNs22ausHwmyAa+sdbjZ63KwRZgPuBI+bDR43GwizhjshvjHbMOZfulXrzxNeK2/4x2bC7IB/LBFNj/MrapaIJhtgJwQimipulQimArsg4LGEB2jAIwnvWgGPI4dHZ4i4VXzgC3h0WcSt4sFl+LAX8Njy+IwS6onh6XEAmhyd4nDqr3Pvr18j5fH87DCZ368ub64
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
anonymous
anonymous / fizzbuzz.c
Created October 10, 2015 12:50
A FizzBuzz program. Somehow. I don't know why it works.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <gmp.h>
char * polynomial="-74101463560860539810482394216134472786413399/404009590666424903383979388988167534591844018460526499864038804741201731572423877094984692537474105135297393596654648304117684895744000000000000000000000*x^99 + 1786563401621773217421750502452955853226339781/1943688752347061390850759947022111850270039951356484879070977067483444756705819339975871373032521468004867185688372878439054154137600000000000000000000*x^98 - 27321291157050372775340569532625689973429185264741/12024094960310264981666053243695462339042976739896622019763059664916718201560234437350734896948634081407660523709959770955883479040000000000000000000000*x^97 + 4936870031754926645682423836151042176171669450909/1336493173680525187613977630110369004256312194947800263402124063124652591386915768177479078216982141485276408003996973457735680000000000000000000000*x^96 - 24473118674386691114350902920738421254018653211816783/55093218603941649400531744530105211175454647
@jonathansimmons
jonathansimmons / base16.css
Last active February 3, 2020 08:36
Base 16 Ocean Dark Slack Theme
/* Not perfect but looks good considering slack limitations */
#2B2F3A,#1F232C,#1F232C,#DFE1E8,#4F5C65,#90A2B2,#A1C088,#C36069
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@joepie91
joepie91 / gulp.bundleLogger.js
Last active May 26, 2023 19:38
gulpfile for CoffeeScript + LiveReload + some other stuff
/* bundleLogger
------------
Provides gulp style logs to the bundle method in browserify.js
*/
var gutil = require('gulp-util');
var prettyHrtime = require('pretty-hrtime');
var startTime;
module.exports = {
@dbehnke
dbehnke / client.py
Created March 18, 2014 19:08
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
"""
client.py - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running server.py
It will handshake and run similar to this:
Server: HELLO
Client: WORLD
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.