Skip to content

Instantly share code, notes, and snippets.

View jalcine's full-sized avatar
💭
Decentralize and democratize the Web.

Jacky Alciné jalcine

💭
Decentralize and democratize the Web.
View GitHub Profile
@bramreth
bramreth / Player.gd
Created July 24, 2023 23:52
How to make a 3D Platfomer in Godot 4: Setup, Movement, and Camera Controls - code dump
extends RigidBody3D
var mouse_sensitivity := 0.001
var twist_input := 0.0
var pitch_input := 0.0
@onready var twist_pivot := $TwistPivot
@onready var pitch_pivot := $TwistPivot/PitchPivot
func _ready() -> void:
@simonwo
simonwo / s3vfs.py
Created September 28, 2021 10:08
SQLite Virtual File System for S3 – MVP
import boto3
import apsw
BLOCK_SIZE = 64 * 1024
EMPTY_BLOCK = b"".join([b"\x00"] * BLOCK_SIZE)
# Inheriting from a base of "" means the default vfs
class S3VFS(apsw.VFS):
def __init__(self, s3, bucket, vfsname=f"s3vfs", basevfs=""):
self.vfsname = vfsname
@KoryNunn
KoryNunn / handshake-airdrop.md
Last active March 12, 2024 07:03
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.

@andrey-yantsen
andrey-yantsen / README.md
Last active August 29, 2023 16:45
Binge-watching scripts for sonarr+plex

Summary

Normally, when you're watching a TV-Show — you don't need all its episodes right away; you just need a few for the next hour or so. The following scripts help you with exactly this! plex-autotag.py marks the new shows you add with tag keep1; plex-autodelete.py removes watched episodes from your drive; sonarr-refresher.py triggers sonarr to download few new episodes, to keep you always having your next fix. All in all — sonarr will download you a new episode after you've watched one.

All this magic works only for "main" user.

The autodelete script was originally taken from plex-api and then it was modified to remove only watched episodes, plus I've added a couple of tags.

It would've been better to make the sonarr script to work directly with Plex API instead of relying on the deleted files, but I'm not there yet.

@BrianHung
BrianHung / codemirror-syntax-highlight.ts
Last active March 19, 2024 19:53
ProseMirror CodeBlock Syntax Highlighting using CM6
import {LanguageDescription, LanguageSupport} from "@codemirror/language"
import {languages} from "@codemirror/language-data"
import {highlightTree} from "@codemirror/highlight"
import {highlightStyle} from "./highlight-style"
export function syntaxHighlight(text: string, support: LanguageSupport, callback: (token: {text: string; style: string; from: number; to: number}) => void, options = {match: highlightStyle.match}) {
let pos = 0;
let tree = support.language.parseString(text);
highlightTree(tree, options.match, (from, to, classes) => {
from > pos && callback({text: text.slice(pos, from), style: null, from: pos, to: from});

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0

Hi Tom!

Here's what the Markdown for a book looks like on macwright.org:

---
categories:
  - book
layout: book
title: 'My Year of Rest and Relaxation'
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@dphiffer
dphiffer / email_to_google_recruiter.md
Created January 9, 2019 21:58
Re: Greetings from Google!

Hi B—,

I appreciate that I made it through your candidate filters, it is a true privilege. I have friends at Google and, from what I've heard, it seems like it can be a great place to work.

Unfortunately I cannot imagine working at Google and I feel a responsibility to pass along my reasoning to you in the hopes that I might (if marginally) make a case for better corporate business practices. I want to make a case that key strategic choices are impacting your capacity to attract talent.

  • It doesn't seem like the conditions that motivated the Google Walkout have been fundamentally addressed.
  • Project Maven, Dragonfly, and probably other things that haven't yet come to light are extremely troubling.
  • A detail from the Dragonfly story that struck me was how the company excluded the privacy review team from its considerations.
  • From CNBC: "Google's annual diversity report reveals that the company's workforce is still largely white and male and that it made very little progress in the last year to change th
@cleverdevil
cleverdevil / overcast-recently-played.py
Last active March 4, 2024 09:28
Fetch recently played episodes from Overcast.fm. Then, publish history to my website.
'''
You'll need to pip install some dependencies:
* python-dateutil
* requests
Also, populate your EMAIL and PASSWORD below.
'''
from xml.etree import ElementTree