Skip to content

Instantly share code, notes, and snippets.

View cxdy's full-sized avatar
🤠
Yee haw

Cody Kaczynski cxdy

🤠
Yee haw
View GitHub Profile
@cxdy
cxdy / a.md
Created October 31, 2022 08:42

wrote this for a pretty specific purpose but if you wanted to attempt to fairly/randomly schedule four people weekly shifts and avoid the same employee having the shift two weeks in a row and also generate a calendar at the same time, here you go

@cxdy
cxdy / docker.sh
Created December 5, 2021 21:55
oneliner to install docker because i have to look it up every time
apt update && apt upgrade -y && apt install -y apt-transport-https ca-certificates curl software-properties-common && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" && apt install docker-ce -y
@cxdy
cxdy / exif.js
Created July 6, 2019 14:55
callback mania
var ExifImage = require('exif').ExifImage;
var image = 'DSC_8041.jpg';
// Step 5, send data off
function finish(EXIF) {
console.log(`Finished EXIF: ` + JSON.stringify(EXIF));
return EXIF;
}
// Step 4, reformat data
@cxdy
cxdy / fracs.js
Created July 6, 2019 13:52
Decimal -> Simplified Fraction in Javascript
// This was made to convert shutter speeds from node-exif from decimals of a second to fractions of a second.
// Example: 0.00125 converts to 1/800
var input = "0.00125";
function doMath(result, string) {
console.log(`${string} is ${result[0]}/${result[1]}th of a second`);
return result;
}
@cxdy
cxdy / lastfm.php
Created December 15, 2017 12:36
last fm current song
<?php
/**
* Package: Scrobbl.in Core (http://github.com/cxdy/Scrobbl.in)
* Version: 2.0
* Authors: Cody Kaczynski (http://github.com/cxdy)
* License: MIT License (http://opensource.org/licenses/MIT)
* You can obtain a Last.FM API key at http://www.last.fm/api/account/create
* Read the documentation (https://github.com/cxdy/Scrobbl.in/blob/master/README.md)
**/

Keybase proof

I hereby claim:

  • I am cxdy on github.
  • I am cxdy (https://keybase.io/cxdy) on keybase.
  • I have a public key whose fingerprint is B4EC 2AE4 9B6A 82CC CC90 018C 8C03 06AE 682E 59A7

To claim this, I am signing this object:

@cxdy
cxdy / sqli.py
Created November 26, 2014 02:59
Easy SQLi Finder
import requests, sys
# This program shows the simplicity
# of requests, Best library ever.
sqlcheck = ["SQL error:", "Warning:", "supplied argument", "PHP Warning:"]
if len(sys.argv) == 1:
print "usage: sqli.py http://hostname.com/"
exit(0)
@cxdy
cxdy / example.html
Created October 5, 2014 00:07
Using Scrobbl.in
<div class="lastfm"></div>
<script>
var scrobblinRefreshTimer = 10;
var scrobblinFileLocation = 'scrobblin.php';
$(document).ready(function() {
refreshScrobblin();
setInterval(function() { refreshScrobblin() }, scrobblinRefreshTimer * 1000);
@cxdy
cxdy / Form1.cs
Created October 2, 2014 13:39
C# Simple Calculator
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SimpleCalculator
@cxdy
cxdy / httpserver.js
Created September 30, 2014 21:08
An example of an HTTP server
// Load the http module to create an http server.
var http = require('http');
// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
// Listen on port 8000, IP defaults to 127.0.0.1