Skip to content

Instantly share code, notes, and snippets.

@luizomf
luizomf / ambiente-dev-ubuntu-curso-python.sh
Created October 31, 2022 01:23
Instalação ambiente dev Ubuntu 22 do curso de Python
#!/bin/bash
# Executar comandos a seguir para atualizar os pacotes
sudo apt update -y
sudo apt upgrade -y
# Só o Python
sudo apt install python3.10-full python3.10-dev -y
# Instalar pacotes a seguir
@PhirePhly
PhirePhly / ISA.txt
Created March 26, 2012 20:42
Intro to the ISA bus by Mark Sokos
THE ISA AND PC/104 BUS
IBM, IBM/XT, IBM PC, and IBM PC AT are registered trademarks of
International Business Machines Corporation.
This file is designed to give a basic overview of the bus found in
most IBM clone computers, often referred to as the XT or AT bus. The
AT version of the bus is upwardly compatible, which means that cards
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 12:44
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mrkline
mrkline / c_sharp_for_python.md
Last active May 6, 2024 12:43
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@YeapGuy
YeapGuy / airtag-decryptor.swift
Last active May 6, 2024 12:42
Decrypt macOS Find My .record file
//
// airtag-decryptor.swift
//
//
// Created by Matus on 28/01/2024.
//
import Foundation
import CryptoKit
// Function to decrypt using AES-GCM
@FikretHassan
FikretHassan / report-heavy-ad-intervention.js
Last active May 6, 2024 12:42
Add this to your creative / creative wrapper to log chrome heavy ad interventions to the console
const observer = new ReportingObserver(
(reports, observer) => {
console.log('ADTECH: reporting observer results:', JSON.stringify(reports));
}, {
buffered: true
}
);
// start watching for interventions
observer.observe();
@johnpierson
johnpierson / PrompForSaveApp.cs
Last active May 6, 2024 12:42
This is an example of an application level add-in that would prompt a user to save if they need to when launching dynamo.
#This code is proudly provided under the BSD-3-Clause, https://opensource.org/licenses/BSD-3-Clause
using System;
using Autodesk.Internal.Windows;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Events;
using Autodesk.Revit.UI;
namespace PromptForSaveOnDynamoLaunch
{
@vidia
vidia / nginx-unificontroller.conf
Last active May 6, 2024 12:41
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
@maxfi
maxfi / install-latest-tig.sh
Created July 13, 2018 08:32
Install latest version of tig
tig --version
sudo apt -y remove tig
cd /tmp
git clone https://github.com/jonas/tig
cd tig
make configure && ./configure && make && sudo make install && sudo make install-release-doc
@maxfi
maxfi / custom-reconnect.js
Created February 13, 2019 06:25
[Meteor custom reconnect] #meteor
import { Meteor } from 'meteor/meteor'
import _ from 'lodash/fp'
Meteor.startup(() => {
Tracker.autorun(() => {
const { status, retryCount } = Meteor.status()
if ((status === 'waiting') && (retryCount >= 5)) {
const interval = _.random(0, 1000 * 120)
Meteor.disconnect()
console.warn(`5 or more reconnection attempts. Reconnecting in ${interval} ms.`, Meteor.status())