Skip to content

Instantly share code, notes, and snippets.

View archan937's full-sized avatar
🤔
Always thinking about writing the next most creative and nifty piece of software

Paul Engel archan937

🤔
Always thinking about writing the next most creative and nifty piece of software
  • BettyBlocks
  • The Netherlands, Amsterdam
View GitHub Profile
@archan937
archan937 / car-owners.37K.json
Created August 21, 2023 12:00
Dummy JSON data of car owners (37K)
This file has been truncated, but you can view the full file.
[
{
"name": "Phillip Bode",
"phone": "(463) 776-7503",
"title": "Miss",
"car": "Jeep Land Cruiser"
},
{
"name": "Vickie Homenick",
"phone": "(763) 838-2156",
@archan937
archan937 / car-owners.5K.json
Created August 21, 2023 11:55
Dummy JSON data of car owners (5K)
[
{
"name": "Harvey Renner",
"phone": "(478) 245-7781",
"title": "Mrs.",
"car": "Cadillac Explorer"
},
{
"name": "Gwendolyn Brown",
"phone": "(832) 215-8487",
@archan937
archan937 / car-owners.15K.json
Created August 21, 2023 11:50
Dummy JSON data of car owners (15K)
This file has been truncated, but you can view the full file.
[
{
"name": "Santiago Bartell",
"phone": "(005) 538-8149",
"title": "Miss",
"car": "BMW Camry"
},
{
"name": "Phil Hessel",
"phone": "(371) 656-8970",
@archan937
archan937 / setup-dnsmasq.sh
Last active October 8, 2024 17:34
Point *.test to 127.0.0.1 using DNSMasq and NetworkManager on Ubuntu
#!/bin/bash
# Usage:
#
# curl -sL https://gist.githubusercontent.com/archan937/d35deef3b1f2b5522dd4b8f397038d27/raw/setup-dnsmasq.sh | sudo bash
#
DOMAIN=".test"
ensure_ping() {
@archan937
archan937 / module.js
Last active October 22, 2020 08:32
Javascript Module Pattern
const MyCoolModule = (() => {
let
privateState = {},
privateVariable = 'private',
bothPrivateAndPublicVariable = 'private and public',
init = () => {
// do some initialization stuff
console.log('Initialized MyCoolModule!');
},
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.
ssl_session_cache shared:le_nginx_SSL:10m;
ssl_session_timeout 1440m;
ssl_session_tickets off;
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
-----END DH PARAMETERS-----
require "net/telnet"
def keys(hosts, pattern = nil)
[hosts].flatten.each do |host|
slabs = {}
telnet = Net::Telnet::new("Host" => host, "Port" => 11211, "Timeout" => 3)
telnet.cmd("String" => "stats items", "Match" => /^END/) do |stats|
slabs = Hash[stats.scan(/STAT items:(\d+):number (\d+)/)]
end
@archan937
archan937 / 1.simple-examples.ex
Last active September 10, 2019 07:06
Amsterdam |> Elixir (10-09-2019) (see also: https://github.com/archan937/clustorage)
# iex(1)>
ast = quote do: 1 + 1
# iex(2)>
Code.eval_quoted(ast)
# iex(3)>
ast = quote do: sum(1, 2 + 3)
# iex(4)>
@archan937
archan937 / README.md
Last active February 28, 2019 14:51
Alkmaar Elixir Meetup (20-06-2018)

Alkmaar Elixir Meetup demo (20-06-2018)

A simple host and client script written in Elixir. Hosting a little Elixir quiz.

Running locally (on your own computer)

Run the following in two Terminal windows:

iex -r host.ex