Skip to content

Instantly share code, notes, and snippets.

@Phuseos
Phuseos / RGBValidationTest.html
Last active September 29, 2017 14:09
Simple RGB colour validation test using jQuery and regex
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js" ></script>
</head>
<body>
<input id="txtValue" type="text" placeholder='Type your RGB code here!'/>
<div id="testValidation" ></div>
<script>
//JQuery keyPress event for validation
@Phuseos
Phuseos / DownloadFTPContent.bat
Last active August 1, 2017 05:44
Download FTP tree recursive with BAT and Bash
@echo off
echo Made by https://gist.github.com/Phuseos
echo Preparing to download the FTP full tree.
:: Set the dir to the dir where the BAT file is located
pushd %~dp0
:: Show the current file location for dubble checking
echo Current location: %cd%
@Phuseos
Phuseos / DownloadFromFTP.bat
Created July 26, 2017 10:05
Auto download all files from single FTP directory
REM Auto download all files from a single FTP directory
REM Made with help from https://gist.github.com/lyze237
@echo off
REM Make sure we have a dedicated folder to write to
if not exist "C:\Users\User\Desktop\FTP" mkdir "C:\Users\User\Desktop\FTP"
REM CD to the folder
cd C:\Users\User\Desktop\FTP
@Phuseos
Phuseos / ReturnDatabaseInfo.cs
Created June 1, 2017 06:59
Quick method for fetching database information
public static List<string> InfoReturner(List<string> infoToReturn)
{//Load in data based on the string in the List<string>
List<string> ReturnedInfo = new List<string>();
/*
How this works: Create a list that holds the info you want to have.
The list with info obtained will be returned so you can use it like below:
System.Collections.Generic.List<string> GetUserInfo = new System.Collections.Generic.List<string>();
GetUserInfo.Add("Email");
@Phuseos
Phuseos / RedirectToHTTPS.xml
Created May 24, 2017 07:52
(XML) Web.Config rewrite rule to auto-redirect to HTTPS
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear/>
<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true"/>
@Phuseos
Phuseos / AutoRunVirtualMachine.bat
Last active May 25, 2017 15:06
Run headless virtual machine using VirtualBox
@ECHO OFF
:: Navigate to the default VirtualBox install directory
C:
cd C:\Program Files\Oracle\VirtualBox
:: Run the VM Headless
start /wait VBoxManage.exe startvm "YourVMName"
:: The loop, find the task, keep looping until a not found error is thrown
:LOOP
tasklist | find /i "VirtualBox" >nul 2>&1
@Phuseos
Phuseos / InteractiveFizzBuzz.bat
Created May 17, 2017 08:52
Interactive FizzBuzz BATCH
:: 'Interactive' FizzBuzz in BAT
:: Start off with clearing the terminal
CLS
:: Give a little welcome message
ECHO "Fizzbuzz in BAT".
:: Turn off echo, allow variables to expand at execution time
@ECHO OFF & SETLOCAL ENABLEDELAYEDEXPANSION
:: Start looping
:START
ECHO "To what number should FizzBuzz run?"
@Phuseos
Phuseos / RPS.html
Last active May 8, 2017 10:21
Simple Rock, Paper, Scissors game in JavaScript
<HEAD>
<Script type="text/javascript" src="RPS.js"></Script>
</HEAD>
<BODY>
<p> Welcome to rock, paper, scissors. To play, type 'r' for rock, 'p' for paper and 's' for scissors.</p>
<p>
Your choice: <input type="text" id="playTxt">
<input type="submit" value="Submit" id="btnPlay" onclick="playGame()">
</p>
<p id="pInfoUser"></p>
@Phuseos
Phuseos / RockPaperScissors.py
Created May 3, 2017 19:04
Simple Rock Paper Scissors Game
# Made for Python version 2.7 and up
import sys
import random
# Rock, paper scissors
# Declare global
# Program will run until this global has a value of 1
glob_WinLose = 0
@Phuseos
Phuseos / PythonAdventure.py
Last active May 3, 2017 11:10
Simple text adventure game
# Made by Phuseos
# https://gist.github.com/Phuseos/
# Thanks for playing!
# Runs best using Python 2.7 and up
# ToFix : inventory doesn't work yet, repeat commmands crash
import sys # General usage
import math # Used for calculations (duh)
#import pdb
#pdb.set_trace()