Skip to content

Instantly share code, notes, and snippets.

View P1xt's full-sized avatar
🏠
Working from home

P1xt P1xt

🏠
Working from home
  • Freelance
  • Minneapolis, MN, USA
View GitHub Profile
@P1xt
P1xt / Set Intersection
Created August 5, 2014 09:08
Set Intersection
var fs = require("fs");
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (line) {
if (line != "") {
console.log(processLine(line));
}
});
function processLine(line) {
var lists = line.split(";");
@P1xt
P1xt / C++ Hello World
Created August 5, 2014 17:26
C++ Hello World
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
cin.get();
return 0;
@P1xt
P1xt / Exercise 2
Created August 5, 2014 19:12
Exercise 2
/**
* Change the "Hello, World!" example above to display another line.
* If Spock were doing this exercise, he might add to
* it so that it would display:
*
* Hello, World!
* Live long and prosper.
*
**/
@P1xt
P1xt / Exercise 1
Created August 5, 2014 19:14
Exercise 1
/**
* Copy the following, then edit it so it compiles correctly
* and prints "Hello, World!" on the screen.
*
* #include<iosteam.h>
* void main()
* {
*
* cout<<"Danny Walling";
* cin getput();
@P1xt
P1xt / 1.cpp
Created August 6, 2014 17:37
CS107 Unit 1 Assessment Problem 1
/* Problem 0.1
*
* Electronic parrot: Reads in a float from the user and prints it on
* the console.
*/
#include <iostream>
#include <iomanip>
#include <limits>
using namespace std;
@P1xt
P1xt / 0.cpp
Created August 6, 2014 17:39
CS107 Unit 1 Assessment Problem 0
/* Problem 0
* To run this program, you'll need to have a file named
* datafile.dat in the working directory.
*/
#include <iostream>
#include <fstream> // For ifstream
#include <string>
using namespace std;
@P1xt
P1xt / 2.cpp
Created August 6, 2014 18:01
CS107 Unit 1 Assessment Problem 2
int main () {
int climber, floater;
int* blocker = &climber;
int* bomber = new int;
int* builder = new int;
int* basher = builder;
int* miner = blocker;
int* digger = new int;
*digger = *blocker;
/* builder was created with a "new int" assignment,
@P1xt
P1xt / roller_coaster.cpp
Created August 8, 2014 21:06
Roller Coaster in c++
#include <iostream>
#include <fstream> // For ifstream
#include <string>
#include <locale>
using namespace std;
int main(int argc, char* argv[]) {
ifstream file;
string line;
file.open(argv[1]);
@P1xt
P1xt / saylor.js
Created September 9, 2014 00:13
Greasemonkey script to shrink the text in the new crazy arsed Saylor redesign down to something usable ... seriously 4em ... w t hell people
// ==UserScript==
// @name saylor
// @namespace P1xt
// @description Fix Saylor font sizing
// @include http://www.saylor.org/
// @include http://www.saylor.org/*
// @version 1
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
@P1xt
P1xt / saylor_resources.js
Last active August 29, 2015 14:06
Saylor's Chemistry textbook is like three kinds of blue-green on blue-green and damn near illegible, this fixes it
// ==UserScript==
// @name saylor resources
// @namespace P1xt
// @description fix the ghastly styling of the chemistry textbook
// @include http://resources.saylor.org/*
// @version 1.003
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;