Skip to content

Instantly share code, notes, and snippets.

View jonsecchis's full-sized avatar

Jon Secchis jonsecchis

View GitHub Profile
@jonsecchis
jonsecchis / how-to-add-image-to-gist.md
Created December 11, 2023 18:20 — forked from mroderick/how-to-add-image-to-gist.md
How to add an image to a gist

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@jonsecchis
jonsecchis / centralized_social_is_dying.md
Created November 20, 2022 19:56
Centralized Social is Dying

Centralized Social is Dying

Increasingly complex security and privacy regulations have been eating away profits of giant social media platforms for some time. By now, Big Social's reputation is far down the drain. In the early 2000's, you wouldn't even consider that an army of legislation specialists were needed to run such basic post-comment platforms – the unpreparedness of their executives front of government scrutinity more than proves that. Nevermind the technological challenges, or even the costs involved in keeping those platforms aligned with common sense regulations such as the GDPR – the morals were lacking from day one and there's no hotfix for that. Now you have crumbling democracies all over the world, with big, thick and flashing red arrows pointing to Big Social as the key igniter.

Twitter is now posing as the centerpiece in the social game, with a new chieftain speeding up its already ongoing decay.

@jonsecchis
jonsecchis / ergo.md
Last active September 9, 2022 02:34
Ergonomics for computerists: two and a half analogies.

Ergonomics for computerists: two and a half analogies.

Imagine an analog radio.

Out of tune, there’s noise.

In tune, there’s music.

Out of tune, noise reveals radio.

@jonsecchis
jonsecchis / nginx.conf
Created June 30, 2022 18:40 — forked from jrom/nginx.conf
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
#!/usr/bin/env python3
#
# Test script to convert between xtilt/ytilt (Qt, Windows) and azimuth/altitude (iOS)
# Free to use for any purpose
import math
import secrets
# [azimuthRad, altitudeRad] => [tiltXrad, tiltYrad]
# azimuth in [0, 2*pi] range, altitude in [0, pi/2]
@jonsecchis
jonsecchis / spec.log
Created December 24, 2021 19:18
Semantic notation for logical specifications
Ledger
Entries is sequence of Position and Operation
Position
Shares is Number
Average Share Cost is Number
Gains is (Gross Gain, Net Gain) is (Number, Number)
Tax is Number
Total is Shares times Average Share Cost
@jonsecchis
jonsecchis / certbot-amazon-linux.sh
Created May 27, 2021 13:38
Certbot on Amazon Linux 2
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum-config-manager --enable epel
sudo yum install certbot
@jonsecchis
jonsecchis / image-arraybuffer.js
Created April 6, 2021 17:45 — forked from candycode/image-arraybuffer.js
Create a jpg image from ArrayBuffer data
// Simulate a call to Dropbox or other service that can
// return an image as an ArrayBuffer.
var xhr = new XMLHttpRequest();
// Use JSFiddle logo as a sample image to avoid complicating
// this example with cross-domain issues.
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true );
// Ask for the result as an ArrayBuffer.
xhr.responseType = "arraybuffer";
@jonsecchis
jonsecchis / ajax.js
Created October 23, 2020 18:07 — forked from xeoncross/ajax.js
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@jonsecchis
jonsecchis / -etc-sysctl
Created October 22, 2020 20:10 — forked from mbbx6spp/-etc-sysctl
Ephemeral port range on OS X
net.inet.ip.portrange.first=32768
net.inet.ip.portrange.hifirst=32768
net.inet.tcp.msl=1000
# for postgresql
kern.sysv.shmall=65536
kern.sysv.shmmax=16777216
# defaults
net.inet.ip.portrange.lowfirst=1023