Skip to content

Instantly share code, notes, and snippets.

@generalelectrix
generalelectrix / reconnect.rs
Created October 12, 2022 08:18
Application-side CPAL device reconnection
//! Provide an audio input stream that automatically reconnects when disconnected.
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use cpal::{Device, Stream, StreamError};
use log::{info, warn};
use simple_error::bail;
use std::error::Error;
use std::sync::mpsc::channel;
use std::thread;
use std::time::Duration;
@dwchiang
dwchiang / .zshrc
Created April 16, 2014 10:30
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc
@Ronnasayd
Ronnasayd / fundamental_concepts.md
Last active May 10, 2024 20:38
Conceitos fundamentais de linguagens de programação

Conceitos fundamentais de linguagens de programação

Este documento tem a intenção de apresentar alguns dos conceitos fundamentais que permeiam as linguagens de programação. A ideia é mostrar algumas das principais características e diferenças que existem entre elas, para que dessa forma você possa determinar em que momento é melhor escolher uma dada linguagem em detrimento das outras.

Tradução

Compilador

Uma linguagem compilada é aquela no qual um programa chamado compilador irá fazer uma análise sintática, léxica e semântica de toda a estrutura de um código fonte e o converterá em um novo formato conhecido como código objeto que poderá ser identificado pelo computador.

@LitileXueZha
LitileXueZha / vultr-gift-codes.txt
Last active May 10, 2024 20:37
Vultr.com Promo Codes, Coupons, Gift Codes, & Special Offers.
GOVULTR
VULTRMATCH https://www.vultr.com/match/
30FREE50V https://www.vultr.com/promo/try50/
100VULTR30FREE https://www.vultr.com/promo/try100/
30VULTRONEFIFTY https://www.vultr.com/promo/try150/
VULTR200FREE https://www.vultr.com/promo/try200/
FLYVULTR250 https://www.vultr.com/promo/try250/
GIVE100GET35
GIVE100GET25 invalid
@fxn
fxn / foo.cr
Last active May 10, 2024 20:36
# crystal build foo.cr --release
# ./foo 37.7749 -122.4194 34.0522 -118.2437
#
# Around 0.08s.
module GeoCalculator
EARTH_RADIUS_IN_KM = 6371.0
def self.distance(lat1, lon1, lat2, lon2)
dlat = lat2 - lat1
@GreatTaco
GreatTaco / marc-andreessen-library.md
Created December 6, 2017 17:20 — forked from ZackKanter/marc-andreessen-library.md
Marc Andreessen's Library
Book ID Title Author Links
1-A-1 Red Blood and Black Ink: Journalism in the Old West David Dary Amazon |
1-A-2 Media and the American Mind: From Morse to McLuhan Daniel J. Czitrom Amazon | Goodreads
1-A-3 A Social History of the Media: From Gutenberg to the Internet Peter Burke Amazon | Goodreads
1-A-4 Media Technology and Society: A History From the Telegraph to the Internet Brian Winston Amazon | Goodreads
1-A-5 The Television Will be Revolutionized Amanda D. Lotz Amazon | Goodreads
1-A-
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 10, 2024 20:28
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@yovko
yovko / ohmyzsh.md
Last active May 10, 2024 20:28
ZSH (using Oh My ZSH) on Manjaro Linux

ZSH (using Oh My ZSH) on Manjaro Linux

0. If ZSH is not already installed on your Manjaro system you can do it with the command:

sudo pacman -Syu zsh

You do not need to install manjaro-zsh-config and all the other related packages like zsh-syntax-highlighting, zsh-history-substring-search, zsh-autosuggestions, etc., as we will use Oh My Zsh.

@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
@dhondta
dhondta / README.md
Last active May 10, 2024 20:24
Tinyscript steganography tool implementing the Pixel Value Differencing algorithm

StegoPVD

This Tinyscript-based tool allows to apply steganography based on PVD (Pixel Value Differencing) in order to retrieve hidden data from an image.

$ pip install tinyscript
$ tsm install stegopvd