Skip to content

Instantly share code, notes, and snippets.

@BadCoder1337
BadCoder1337 / index.html
Last active July 8, 2023 11:36
Print Issue
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="print.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/favicon.ico">
</head>
<body>
@BadCoder1337
BadCoder1337 / force_labels.js
Last active May 18, 2023 09:06 — forked from ZJONSSON/force_labels.js
Automatic floating labels using d3 force-layout
(function() {
d3.force_labels = function force_labels() {
var labels = d3.layout.force();
// Update the position of the anchor based on the center of bounding box
function updateAnchor() {
if (!labels.selection) return;
labels.selection.each(function(d) {
var bbox = this.getBBox(),
x = bbox.x + bbox.width / 2,
s one method for getting the information you want on a Windows machine. I copied and pasted it from an actual project with some minor modifications, so feel free to clean it up to make more sense.
int CPUInfo[4] = {-1};
unsigned nExIds, i = 0;
char CPUBrandString[0x40];
// Get the information associated with each extended ID.
__cpuid(CPUInfo, 0x80000000);
nExIds = CPUInfo[0];
for (i=0x80000000; i<=nExIds; ++i)
{
@BadCoder1337
BadCoder1337 / mouse_manager.ps1
Last active July 11, 2020 13:08
AFTER THE LAST GAME UPDATE THIS METHOD DOESN'T WORK ANYMORE
Add-Type -AssemblyName System.IO.Compression.FileSystem
Write-Host "Location: $PSScriptRoot"
Write-Host "Username: $env:UserName"
Set-Location $PSScriptRoot
$dataDir = "./mouse_manager_data"
# Get the ID and security principal of the current user account
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
@BadCoder1337
BadCoder1337 / Focuson.pas
Last active December 2, 2019 13:25
Old circle collision project
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, ExtCtrls, StdCtrls, ComCtrls, Buttons, Mask, Math;
type
TForm1 = class(TForm)