Skip to content

Instantly share code, notes, and snippets.

@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())
@kiliman
kiliman / README.md
Last active May 6, 2024 12:39
Debug server-side Remix using VSCode

💡 HOWTO: Debug your server-side Remix code using VSCode

✨ New in Remix v1.3.5

The latest release of Remix fixes sourcemaps so you no longer need to use any hacks to set breakpoints in your route modules. Simply start the debugger and Remix will hit the breakpoint in your loaders and actions.

Debugging session even survives edits and Live Reload.

@ZhouGengmo
ZhouGengmo / Readme.md
Last active May 6, 2024 12:38
rdkit-clustering-conformation-generation

Do Deep Learning Methods Really Perform Better in Molecular Conformation Generation?

[arXiv]

Authors: Gengmo Zhou, Zhifeng Gao, Zhewei Wei, Hang Zheng, Guolin Ke

We revisit the benchmark after simple traditional algorithms beat deep learning methods in conformation generation.

Data