Skip to content

Instantly share code, notes, and snippets.

@Battleroid
Battleroid / 13_05.cpp
Last active December 15, 2015 02:19
Baby name ranking, works. Finds the ranking of the name with given information.
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
using namespace std;
template <typename T>
@Battleroid
Battleroid / 13_09.cpp
Created March 18, 2013 12:38
Cumulative baby ranking. Done really badly, not interested in making it work.
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <iterator>
#include <vector>
using namespace std;
template <typename T>
T stoi (const string &input) {
@Battleroid
Battleroid / vimrc
Created March 25, 2013 03:24
vimrc from server, messy as crap.
"basics
set nu
set bs=2
set t_Co=256
set nocp
set tabstop=2
set softtabstop=2
set shiftwidth=2
set smarttab
set ignorecase
@Battleroid
Battleroid / Codes.cpp
Created March 29, 2013 08:45
Used to make fake CD keys for Steam for shits and giggles.
#include <iostream>
#include <random>
#include <ctime>
#include <vector>
#include <fstream>
#include <string>
using namespace std;
int main () {
string content = "abcdefghijklmnopqrstuvwxyz0123456789";
@Battleroid
Battleroid / 15_01.cpp
Last active December 15, 2015 15:49
Polymorphism in C++.
#include "Triangle.h"
#include <iostream>
using namespace std;
int main()
{
cout << "Enter three sides: ";
double side1, side2, side3;
cin >> side1 >> side2 >> side3;
@Battleroid
Battleroid / mine.bat
Created April 1, 2013 19:21
cgminer defaults.
@echo off
cls
pause
cgminer.exe -o http://ltc.kattare.com:9332 -u WORKERUSERNAME -p WORKERPASSWORD -I 17 --scrypt
@Battleroid
Battleroid / custom-dl.php
Last active December 15, 2015 21:29
PHP script to setup batch file for download which in turn starts cgminer with specified arguments. Notes: added rtrim to remove trailing slashes on URL.
<?php
/* Feel free to use this to your heart's content, but please link back here somewhere, I'd appreciate it. Thanks.
Also if you find any problems, let me know, I'll get to fixing them. */
function addHTTP($url) {
if (!preg_match("~^(?:f|ht)tps?://~i", $url))
$url = "http://" . $url;
return $url;
}
@Battleroid
Battleroid / FizzBuzz.cpp
Created April 8, 2013 00:47
Just some miscellaneous stuff.
// Fizzbuzz
#include <iostream>
using std::cout;
using std::endl;
int main () {
for (int i = 0; i <= 100; i++) {
if (i % 15 == 0)
cout << i << ": FizzBuzz";
@Battleroid
Battleroid / Fiddle.py
Last active December 15, 2015 22:39
Trying to learn some python.
import os
def hello(name):
print 'Hello,', name
os.system('pause')
hello('Casey')
@Battleroid
Battleroid / FizzBuzz.py
Created April 8, 2013 06:57
Fizzbuzz in python. Neato.
import os
for i in range(0, 100):
if i % 15 == 0:
print i,': FizzBuzz'
elif i % 3 == 0:
print i,': Fizz'
elif i % 5 == 0:
print i,': Buzz'
else: