Skip to content

Instantly share code, notes, and snippets.

@cameroncros
cameroncros / Cargo.toml
Created July 8, 2024 00:23
Rust program to generate 1000 orphan/defunct processes.
[package]
name = "orphanage"
version = "0.1.0"
edition = "2021"
[dependencies]
fork = "0.1.23"
@cameroncros
cameroncros / Like all Apple Music songs in a playlist
Last active March 29, 2022 12:49
Like all the songs in a playlist - Apple Music
arr = document.getElementsByClassName('love-or-popular__glyph');
for (let item of arr) {
if (item.attributes['aria-check'].value == "false")
{
console.log("Clicked");
item.click();
await new Promise(r => setTimeout(r, 500));
}
}
#-
- Example of I2C driver written in Berry
-
- Support for DockerPiSensorHub device found in M5Stack
-#
class DockerPiSensorHub : Driver
var wire #- if wire == nil then the module is not initialized -#
var temp1
var temp2
#!/bin/bash
right_adjust () {
WIDTH=$(tput cols)
CHARS=$(echo $1 | wc -c)
PADDING=$(($WIDTH-$CHARS))
SPACES=""
val=$(printf "%*s%s\n" $PADDING " " "$1")
echo "$val"
}
const Discord = require('discord.js');
const client = new Discord.Client();
channel = ""
function send_message() {
channel.send({embed: {
title: "This should be the title",
description: "This is some text",
image: {
@cameroncros
cameroncros / bashrc
Last active March 16, 2019 11:43
Bashrc for git
# Colors for the prompt
COLOR_RED="\033[0;31m"
COLOR_YELLOW="\033[0;33m"
COLOR_GREEN="\033[0;32m"
COLOR_OCHRE="\033[38;5;95m"
COLOR_BLUE="\033[0;34m"
COLOR_WHITE="\033[0;37m"
COLOR_RESET="\033[0m"
function git_color {
@cameroncros
cameroncros / markdown.py
Created July 9, 2018 14:10
Markdown creator for Python
class Markdown:
string = ''
def __init__(self):
self.string = ''
def add_line(self, lines):
self.string += '%s\n' % lines
tempPowerFCW = altitudeForce; // Vertical "force".
tempPowerFCCW = altitudeForce; //
tempPowerRCW = altitudeForce; //
tempPowerRCCW = altitudeForce; //
tempPowerFCW += pitchForce; // Pitch "force".
tempPowerFCCW += pitchForce; //
tempPowerRCW -= pitchForce; //
tempPowerRCCW -= pitchForce; //