Skip to content

Instantly share code, notes, and snippets.

@RubenKelevra
RubenKelevra / fast_firefox.md
Last active April 7, 2025 12:42
Make Firefox fast again
@makevoid
makevoid / install-ruby-3-debian.sh
Last active December 24, 2024 04:16
Install Ruby 3 from soure on Debian (11)
# onliner usage:
# bash <(curl -s https://gist.githubusercontent.com/makevoid/2be2170f17801c761aadfe7d9978b003/raw/ea38c958d092b1000518f8614cab815d6f5a09ac/install-ruby-3-debian.sh)
set -xeuo pipefail
apt update -y
apt install -y build-essential git redis-server cmake vim wget curl libsqlite3-dev python3 apt-transport-https ca-certificates automake libtool libzlcore-dev libyaml-dev openssl libssl-dev zlib1g-dev libreadline-dev libcurl4-openssl-dev software-properties-common libreadline6-dev
mkdir -p ~/tmp
@kathawala
kathawala / datetime_to_cron.py
Created April 21, 2020 22:23
Converts a python datetime to a crontab expression which fires once (at the date+time specified in the python datetime object)
from datetime import datetime
def datetime_to_cron(dt):
# FYI: not all cron implementations accept the final parameter (year)
return f"cron({dt.minute} {dt.hour} {dt.day} {dt.month} ? {dt.year})"
@matt2005
matt2005 / lambda_function.py
Last active April 9, 2025 01:28 — forked from awarecan/lambda_function.py
Alexa Smart Home Skill Adapter for Home Assistant
"""
Copyright 2019 Jason Hu <awaregit at gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
Links:
https://elixir-lang.org/learning.html
https://exercism.io/tracks/elixir
https://github.com/happi/theBeamBook
https://www.manning.com/books/elixir-in-action
@marcelobbfonseca
marcelobbfonseca / middleware.rb
Last active December 13, 2024 13:43
Sinatra ruby JWT authentication middleware
# To connect this middleware.rb file to your sinatra app
# add 'use JWTAuthorization' as one of your first lines in
# your Application class.
# e.g.
# require 'middlewares.rb'
# class Application < Sinatra::Base
# use JWTAuthorization
# ...
# end
@oonsamyi
oonsamyi / enzyme_render_diffs.md
Last active October 21, 2019 07:21 — forked from fokusferit/enzyme_render_diffs.md
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • static getDerivedStateFromProps
@prestia
prestia / installing_MTGO_on_macOS_with_Retina_support.md
Last active February 3, 2025 21:21
Instructions on how to install Magic the Gathering Online on macOS with Retina support.

Installing MTGO on macOS using Wine, and making it look pretty!

The following instructions are heavily inspired by @pauleve. I modified his instructions and then added details about how to make a shortcut and support Retina/HiDPI displays.

Installing MTGO (and Wine and Homebrew and Xquartz and ...)

  1. Install Homebrew by opening Terminal and executing the following command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@jamietre
jamietre / pc-rules.erb
Last active February 28, 2025 14:07
Karabiner Elements config to map home/end keys to PC-like behavior on MacOS X
{
"title": "MacOS -> PC Shortcuts",
"rules": [
{
"description": "Top/bottom of document (ctrl+home/ctrl+end)",
"manipulators": [
{
"type": "basic",
"from": <%= from("home", ["command"], ["any"]) %>,
"to": <%= to([["up_arrow", ["left_command"]]]) %>,
@stephenmm
stephenmm / bash-named-param
Last active July 23, 2018 20:36 — forked from caruccio/bash-named-param
Named parameters in bash
# Do you like python named parameters (kvargs) ?
# Well, you can have it in bash too!! (but unfortunatly this will not allow you to mix positional and named parameters)
function myfunc() { local $*; echo "# foo=$foo, bar=$bar"; }
myfunc bar=world foo=hello
# foo=hello, bar=world
#########
# And with default arguments: