Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Szpadel
Szpadel / rdcalc.py
Last active July 4, 2023 12:25
Resistor Divider CALCulator
#!/usr/bin/env python3
import argparse
import itertools
from rich import print
from rich.table import Table
def format_resistor_value(number):
formatted_number = format(number, ".1f").rstrip('0').rstrip('.')
return formatted_number
@Szpadel
Szpadel / Readme.md
Last active June 12, 2020 11:17
screeps-tracer

Note: Currently this only works via Steam client

Usage:

Trace single function/method

@trace
function something() {
}
#!/usr/bin/env bash
sudo -v
trap 'echo "Something went wrong, restart script to retry"' ERR
set -ex
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
downloadPkg() {
echo "Downloading $1..."
@Szpadel
Szpadel / meltdown-check.sh
Last active January 15, 2018 15:53
Script for checking system status against Meltdown issue
#!/usr/bin/env bash
CR="\e[0m"
CBAD="\e[41m"
CWRN="\e[33m"
COK="\e[32m"
CINF="\e[34m"
isPcidPresent() {
grep -q pcid /proc/cpuinfo
@Szpadel
Szpadel / robot.js
Created December 10, 2012 05:19
Zolmeister
var robots = new Array();
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.start = function( ev ){
@Szpadel
Szpadel / google-maps-info-styles.js
Created June 3, 2015 15:20
Adds css classes to google maps popups
(function(){
function styleAllBoxes() {
var cnt = $('.gm-style-iw');
cnt.each(function(index){
styleBox($(cnt[index]));
});
}
function styleBox(item) {
@Szpadel
Szpadel / example.cpp
Last active August 29, 2015 13:57
MPI Datatybe Builder
#include <mpidatatypebuilder.h>
#include <mpi.h>
using namespace std;
struct DataSet {
double vectorA[131072];
double vectorB[131072];
double arg1;
<?php
class Benchmark
{
private $tests = [];
private $command = "";
private $multiple = 10;
private $results = [];