Skip to content

Instantly share code, notes, and snippets.

View HudsonAfonso's full-sized avatar
:octocat:
Focusing

Hudson Afonso HudsonAfonso

:octocat:
Focusing
View GitHub Profile
@miditkl
miditkl / raspberry_python.sh
Last active December 13, 2023 09:30 — forked from vbe0201/raspberry_python.sh
A shell script for installing Python 3.10.2 on your Raspberry Pi.
#!/bin/bash
# A bash script for installing Python 3.10.2 on your Raspberry Pi.
# (c) 2022 Valentin B. / Midian T. E.
#
# Open your terminal and type the following command:
# sudo wget https://gist.githubusercontent.com/realSnosh/cfe29370d2205bd1ad296e7bc7c9b9ea/raw/raspberry_python.sh && chmod +x raspberry_python.sh && ./raspberry_python.sh
sudo apt-get update -y
sudo apt-get upgrade
@nischalshrestha
nischalshrestha / ambient1.rb
Created May 10, 2020 04:51
Sonic Pi: Ambient 1
##| Ambient 1
with_fx :reverb, room: 0.8, mix: 0.6 do
live_loop :deep_saws do
use_synth :saw
amp = 0
release = rrand_i(5, 8)
attack = rrand(0.8, 3.0)
with_fx :lpf, cutoff: 80 do
@StevenACoffman
StevenACoffman / go-sql.md
Last active October 5, 2020 14:18
Go SQL

Database Environments

A schema contains a group of tables. A database contains a group of schemas.

In prod, we use a cloudsql PostgreSQL instance. The reports DB is for prod only. It's presence should be a gatekeeper to prevent destructive teardowns.

Everywhere else, we assume a local PostgreSQL running on port 5432 with two existing databases. The khan_test DB is for integration tests. The khan_dev DB is for local development.

@fgatti675
fgatti675 / search_fab_transition.dart
Last active May 23, 2019 14:08
Flutter transition from FAB to navigator page
import 'dart:async';
import 'package:flutter/material.dart';
final routeObserver = RouteObserver<PageRoute>();
final duration = const Duration(milliseconds: 300);
void main() => runApp(MaterialApp(
home: HomePage(),
navigatorObservers: [routeObserver],
@prestia
prestia / installing_MTGA_on_macOS_with_Retina_support.md
Last active October 13, 2023 23:22
Instructions on how to install Magic the Gathering Arena on macOS with Retina support.

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

The following instructions are heavily inspired by /u/uhohohdear. I modified uhohohdear's instructions and then added support for Retina/HiDPI displays and instructions about how to update MTGA.

IMPORTANT UPDATE: This will no longer work if you upgrade to macOS Catalina, as Wine and Wineskin are 32-bit. I'll update this Gist with 64-bit versions when they become available.

We're back in business!

It appears that the workarounds no longer work. A few people with Macs using Nvidia graphics cards are having success, but Macs with Intel and AMD GPUs crash regularly. At this time, the best way to play Arena on Mac is via Boot Camp or GeForce Now.

@npearce
npearce / install-docker.md
Last active May 22, 2024 10:13
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@beginor
beginor / snowflake-id.sql
Last active May 11, 2024 18:48
Twitter Snowflake ID for PostgreSQL
CREATE SEQUENCE public.global_id_seq;
ALTER SEQUENCE public.global_id_seq OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.id_generator()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
@wilforlan
wilforlan / using-bs-in-ionic.txt
Created March 13, 2018 10:27
Using bootstrap css inside ionic app
Create a file
> src/assets/scss/tools/_bootstrap.min.scss
Paste this inside
```
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
@jackkoppa
jackkoppa / fix-sw.js
Last active August 10, 2023 20:40
Workaround npm build script, to temporarily fix Angular #21636 (see https://github.com/angular/angular/issues/21636#issuecomment-366205459)
/*
*
* Temporary fix for https://github.com/angular/angular/issues/21636
*
* Include in your project; run after the `ng build --prod` step by running `node location/of/this/script/fix-sw`
*
* Warning: removes any instances of setting EXISTING_CLIENTS_ONLY state, which will likely have adverse effects in some situations
*
*/
@tariqk
tariqk / gsheet-hashfunc.gs
Created February 10, 2018 13:03
Hash digest functions for Google Sheets — uses Utilities.computeDigest() from Google App Scripts
/**
* Returns the hash digest of a single cell or an array of cells.
*
* @param {"Sample text"} input - Text to hash.
* @param {"MD5"} algorithm - (optional) Hashing algorithm to use. Choose between MD2, MD5, SHA-1, SHA-256, SHA-384 and SHA-512. Defaults to MD5.
* @customfunction
*/
function HASH(input, algorithm) {
input = input || "" // what, nothing? FINE, you get nothing. Jerks.
if (input.map) { // check if it's an array, and make sure that the same damn algorithm is used.