Skip to content

Instantly share code, notes, and snippets.

View ashnur's full-sized avatar
🐢
fragments of scrolls surround me

Aron Gabor ashnur

🐢
fragments of scrolls surround me
View GitHub Profile
@ashnur
ashnur / keycloak.sh
Created November 10, 2017 18:10 — forked from paoloantinori/keycloak.sh
Keycloak Admin API Rest Example
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@ashnur
ashnur / no-hackerrank.md
Created February 26, 2018 14:56 — forked from fasiha/no-hackerrank.md
A prospective employer invited me to do a HackerRank test. Here's my proposed alternative.
To: recruitment@EmployerABC.com
From: Ahmed Fasih
Subject: Re: Programming Test Invitation

Hi there! Thanks for offering to let me take a HackerRank test for ABC, I appreciate the vote of confidence.

I'd never heard of HackerRank, but after you wrote two other employers sent me their own HackerRank tests. Having worked on those tests first (I considered them practice, for the real thing with ABC :), I'd like to check if you have flexibility in finding an alternative way to evaluate my basic coding chops.

This is because, as functional programmer and author Paul Chiusano says, "Programming is all about managing complexity" [1], but HackerRank is quite bad at measuring my ability to manage complexity. It asks for small algorithmic coding puzzles to be done in unnatural conditions including (1) time limits, (2) forbidding research on Wikipedia or StackOverflow, (3) forbidding collaboration, and (4) forbidding the use of libraries (Python and JavaScript e.g. are so different when confined to thei

@ashnur
ashnur / todo.js
Created March 18, 2019 18:17 — forked from WebReflection/todo.js
Web Components, the React way, without Shadow DOM
// https://hackernoon.com/web-components-the-react-way-8ed5b6f4f942#.5em3zpgin
const store = (() => {
let state;
return todos => {
if (todos) {
state = todos;
render("todo-list");
}
return state;
};
@ashnur
ashnur / .gitconfig
Created July 12, 2019 16:34 — forked from 0livare/.gitconfig
My git alias list. Running 'git alias' will pretty-print these commands to the terminal.
[alias]
# === Common Commands ===
s = status # Shortcut for status
b = branch # Shortcut for branch
a = add # Shortcut for add
d = difftool # Shortcut for difftool
m = mergetool # Shortcut for mergetool
f = fetch --all --prune
po = push origin # Shortcut for push origin
@ashnur
ashnur / main.md
Created December 3, 2019 02:06 — forked from hediet/main.md
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@ashnur
ashnur / genius-programmer.md
Created January 14, 2020 20:37 — forked from joepie91/genius-programmer.md
The One Secret Trick To Becoming A Genius Programmer

The One Secret Trick To Becoming A Genius Programmer

Okay, the title of this post is a bit of a lie. There's no one secret trick to becoming a genius programmer - there are two, and they're more habits than tricks. Nevertheless, these kind of 'secret tricks' seem to resonate with people, so I went for this title anyway.

Every once in a while, a somewhat strange thing happens to me. I'll be helping somebody out on IRC - usually a beginner - answering a number of their questions in rapid succession, about a variety of topics. Then after a while, they call me a "genius" for being able to answer everything they're asking; either directly, or while talking about me to somebody else.

Now, I don't really agree with this "genius" characterization, and it can make me feel a bit awkward, but it shows that a lot of developers have a somewhat idealistic and nebulous notion of the "genius programmer" - the programmer that knows everything, who can do everything, who's never stumped by a problem, and of which ther

@ashnur
ashnur / genius-programmer.md
Created January 14, 2020 20:37 — forked from joepie91/genius-programmer.md
The One Secret Trick To Becoming A Genius Programmer

The One Secret Trick To Becoming A Genius Programmer

Okay, the title of this post is a bit of a lie. There's no one secret trick to becoming a genius programmer - there are two, and they're more habits than tricks. Nevertheless, these kind of 'secret tricks' seem to resonate with people, so I went for this title anyway.

Every once in a while, a somewhat strange thing happens to me. I'll be helping somebody out on IRC - usually a beginner - answering a number of their questions in rapid succession, about a variety of topics. Then after a while, they call me a "genius" for being able to answer everything they're asking; either directly, or while talking about me to somebody else.

Now, I don't really agree with this "genius" characterization, and it can make me feel a bit awkward, but it shows that a lot of developers have a somewhat idealistic and nebulous notion of the "genius programmer" - the programmer that knows everything, who can do everything, who's never stumped by a problem, and of which ther

@ashnur
ashnur / gist:b5da0c3692ae64fd9c6d7c1012acaf1d
Created January 21, 2020 07:28
Does this request make sense?
Write one Javascript statement on the indicated line that will make the printed number always be between 10 and 20 *
let x = 2;
let y = 8;
const a = function(b) { return function(c) { return x + y + Math.abs(b) + c; } };
// Statement will go here
const fn = a(x);
x = 4;

Let's start with the basics of how X Window System works. X uses client-server model. An X server program runs on a computer with a graphical display and communicates with various client programs (X clients). The X server acts as a go-between for the user and the client programs, accepting requests for graphical output from the client programs and displaying them to the user (display), and receiving user input (keyboard, mouse) and transmitting it to the client programs.

In X, the server runs on the user's computer, while the clients may run on remote machines. This terminology reverses the common notion of client–server systems, where the client normally runs on the user's local computer and the server runs on the remote computer.

Let's start with the basics of how X Window System works. X uses client-server model. An X server program runs on a computer with a graphical display and communicates with various client programs (X clients). The X server acts as a go-between for the user and the client programs, accepting requests for graphical output from the client programs and displaying them to the user (display), and receiving user input (keyboard, mouse) and transmitting it to the client programs.

In X, the server runs on the user's computer, while the clients may run on remote machines. This terminology reverses the common notion of client–server systems, where the client normally runs on the user's local computer and the server runs on the remote computer.