Skip to content

Instantly share code, notes, and snippets.

View agentofuser's full-sized avatar
🥌
agentofuser.com

Helder S Ribeiro agentofuser

🥌
agentofuser.com
View GitHub Profile
@seanh
seanh / mergelog.py
Created April 25, 2010 18:50
A custom merge driver for git, for automatically merging my 'log.txt' file in a simplistic way.
#!/bin/env python
"""mergelog
This is a custom merge driver for git. It should be called from git
with a stanza in .git.config like this:
[merge "mergelog"]
name = A custom merge driver for my log.txt file.
driver = ~/scripts/mergelog %O %A %B %L
recursive = binary
@dherman
dherman / realms-api.md
Last active March 8, 2024 07:04
ES6 Realms API

Notational Conventions

This section describes the conventions used here to describe type signatures.

A [T] is an array-like value (only ever used read-only in this API), i.e., one with an integer length and whose indexed properties from 0 to length - 1 are of type T.

A type T? should be read as T | undefined -- that is, an optional value that may be undefined.

Realms

@Su-Shee
Su-Shee / gist:5d1a417fa9de19c15477
Last active June 3, 2024 20:49
Falsehoods Programmers Believe About "Women In Tech"

Falsehoods Programmers Believe About "Women In Tech"

  • We have absolutely no idea what we're doing in tech. Please explain the utmost basic things to us.

  • We only do web design. Our whole reason of being in tech is to make things pretty. Consider us the doilies of the industry.

  • We're not laughing about your joke, so we clearly need you explain it to us. In great detail.

  • We're only in tech to find a husband, boyfriend or generally to get laid.

@evelynharthbrooke
evelynharthbrooke / chromium-about.md
Last active February 20, 2024 03:06
Up-to-date list of all available internal Chromium-based browser pages.

Overview of all chromium:// pages.

This list may be out of date, for completely up-to-date information please refer to your browser's dedicated internal URL listing.

This list contains internal URL listings for Google Chrome and Microsoft Edge (Chromium), the current most popular browsers based on the Chromium browser project.

List of Chrome URLs

chrome://about
chrome://accessibility
chrome://appcache-internals
@ipbastola
ipbastola / jq to filter by value.md
Last active June 5, 2024 09:07
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

self: super:
{
# Install overlay:
# $ mkdir -p ~/.config/nixpkgs/overlays
# $ curl https://gist.githubusercontent.com/LnL7/570349866bb69467d0caf5cb175faa74/raw/3f3d53fe8e8713ee321ee894ecf76edbcb0b3711/lnl-overlay.nix -o ~/.config/nixpkgs/overlays/lnl.nix
userPackages = super.userPackages or {} // {
# Example:
hello = self.hello;
@Peaches491
Peaches491 / show_keycodes.py
Created June 18, 2019 05:10
Code to print keyboard keycodes for debugging keystroke delays
#! /usr/bin/env python2
import sys
import termios
import tty
stdin_fd = sys.stdin.fileno()
old = termios.tcgetattr(stdin_fd)
try:
tty.setcbreak(sys.stdin)

Always Already Programming

Everyone who interacts with computers has in important ways always already been programming them.

Every time you make a folder or rename a file on your computer, the actions you take through moving your mouse and clicking on buttons, translate into text-based commands or scripts which eventually translate into binary.

Why are the common conceptions of programmer and user so divorced from each other? The distinction between programmer and user is reinforced and maintained by a tech industry that benefits from a population rendered computationally passive. If we accept and adopt the role of less agency, we then make it harder for ourselves to come into more agency.

We've unpacked the "user" a little, now let's look at the "programmer." When a programmer is writing javascript, they are using prewritten, packaged functions and variables in order to carry out the actions they want their code to do. In this way, the programmer is also the user. Why is using pre-made scripts seen

@holyjak
holyjak / fulcro-rad-notes.md
Last active August 2, 2023 16:45
Fulcro RAD - assorted notes

Unsorted notes on Fulcro RAD.

Reports

Displaying to-one :ref attributes

Tony advises:

There are two primary ways to do this. If it is a true to one relationship, then you can simply make a resolver from person ID to address ID in pathom and then you can just include address things as columns. The other option, which works for any cardinality, is to use the report option ro/column-EQL and write a join that pulls the information you want to format in the column, and then supply a column formatter to do the formatting of the nested data.

@donchev7
donchev7 / crypto.ts
Created May 1, 2021 18:50
encrypt - decrypt typescript using NodeJS
import { OPENSSL_VERSION_NUMBER } from 'constants'
import crypto from 'crypto'
import * as env from 'env-var'
const ivSize = 16
const algorithm = 'aes256'
// Check for Heartbleed vulnerabilities
if (OPENSSL_VERSION_NUMBER <= 268443727) {
throw new Error('OpenSSL Version too old')