Skip to content

Instantly share code, notes, and snippets.

View AzureKitsune's full-sized avatar

Alex AzureKitsune

  • 18:44 (UTC -05:00)
View GitHub Profile
@AzureKitsune
AzureKitsune / Program.cs
Created December 30, 2016 04:32
UWM Parking Garage Fee Calculator
using System;
class MainClass {
public static void Main (string[] args) {
DateTime start = DateTime.Now.Subtract(new TimeSpan(10,0,0)); //example starting time. Take our current time and subtract 10 hours from it.
DateTime end = DateTime.Now; //the current time
Console.WriteLine("Start Time: " + start.ToString());
Console.WriteLine("End Time: " + end.ToString());
Console.WriteLine("Price: $" + GetParkingCost(start, end));
}
@AzureKitsune
AzureKitsune / App.java
Created December 21, 2016 22:51
A simple program for performing the fibonacci sequence.
package fib;
import java.util.Scanner;
public class App {
@SuppressWarnings("resource")
public static void main(String[] args) {
Scanner stdIn = new java.util.Scanner(System.in);
while (true) {
function printPossibleFactors(number, maxNumber) {
for(var i = 0; i < maxNumber; i++) {
if ((number/i) == Math.round(number/i)) {
console.log(number/i + " * " + i + " | Sum: " + ((number/i) + i));
}
}
}
printPossibleFactors(40, 100); //get all factors for 40 up to 100.
@AzureKitsune
AzureKitsune / wifi-network-shower.ps1
Created July 2, 2013 16:29
Wraps 'netsh wlan show networks' to print out the available wifi networks.
$procInfo = New-Object -TypeName "System.Diagnostics.ProcessStartInfo"
$procInfo.UseShellExecute = 0
$procInfo.Filename = "netsh"
$procInfo.Arguments = "wlan show networks mode=bssid"
$procInfo.CreateNoWIndow = 1
$procInfo.RedirectStandardOutput = 1
$proc = [System.Diagnostics.Process]::Start($procInfo)
#$proc.WaitForExit()
@AzureKitsune
AzureKitsune / searchExample.html
Last active December 16, 2015 12:49
A web search-like page test.
<!DOCTYPE html>
<html>
<head>
<title>Search Test</title>
<style>
body {
background: #fff;
font-family: 'Source Code Pro', sans-serif;
}
.button, .searchbox {
[Script Info]
; Script generated by Aegisub 3.0.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 1
ScaledBorderAndShadow: yes
Collisions: Normal
PlayResX: 1440
PlayResY: 1080
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dock="clr-namespace:AvalonDock;assembly=AvalonDock"
xmlns:edit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
Title="Open Studio UI Concept" Height="453" Width="728">
<Window.Resources>
<ResourceDictionary Source="/AvalonDock.Themes;component/themes/dev2010.xaml"/>
</Window.Resources>
<Grid>
public struct MyStruct
{
int ID {get;set;} //2 bytes?
int Header {get;set;} //5 bytes?
}
public MyStruct ReadFile(string file)
{
MyStruct m = new MyStruct();
using (var fs = new System.IO.FileStream(file, FileMode.Open))
#
#
# Nimrod's Runtime Library
# (c) Copyright 2010 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
## This module implements a small wrapper for some needed Win API procedures,
import os
type
TUtf16Char = distinct int16
WideCString = ptr array[0.. 1_000_000, TUtf16Char]
const
utf8Encoding = 65001
proc len(w: WideCString): int =