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 / test.py
Created August 15, 2012 01:39
test
1+2
3
@P1xt
P1xt / test.py
Created August 15, 2012 01:42
Test gist
4+3
7
@P1xt
P1xt / mjob
Created November 7, 2013 22:00
MathJax on Blogger
<script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js' type='text/javascript'>
MathJax.Hub.Config({
HTML: ["input/TeX","output/HTML-CSS"],
TeX: { extensions: ["AMSmath.js","AMSsymbols.js"],
equationNumbers: { autoNumber: "AMS" } },
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true },
@P1xt
P1xt / gist:8965731
Created February 12, 2014 22:20 — forked from mstssk/gist:4234745
@P1xt
P1xt / test
Created August 5, 2014 05:01
Testing Python gist
import math
ceil(84.2)
grade_report(80)
def grade_report(grade):
if grade >= 80:
return 'excellent'
elif grade >= 50:
return 'pass'
@P1xt
P1xt / Reverse Groups
Created August 5, 2014 08:50
Reverse Groups
var fs = require("fs");
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (line) {
if (line != "") {
var parsedLine = line.split(";");
var k = parsedLine[1];
var digits = parsedLine[0].split(",");
var length = digits.length;
if (k > 1) {
for (var i = 1; i <= length; i++) {
if (i % (k) === 0) {
@P1xt
P1xt / Prime Palindrome Javascript
Created August 5, 2014 08:57
Prime Palindrome
var highEnd = 1000;
var primes = sieve(highEnd);
highEnd--;
var found = false;
while (found == false ) {
if (isPalindrome(highEnd.toString()) == true) {
if (primes[highEnd] == true) {
found = true;
}
}
@P1xt
P1xt / Prime Palindrome
Created August 5, 2014 08:58
Prime Palindrome
var highEnd = 1000;
var primes = sieve(highEnd);
highEnd--;
var found = false;
while (found == false ) {
if (isPalindrome(highEnd.toString()) == true) {
if (primes[highEnd] == true) {
found = true;
}
}
@P1xt
P1xt / Prime Palindrome
Created August 5, 2014 09:00
Prime Palindrome
<?php
/**
* Write a program to determine the biggest prime palindrome under 1000.
INPUT SAMPLE:
There is no input for this program.
OUTPUT SAMPLE:
Your program should print the largest palindrome on stdout, i.e.
929
@P1xt
P1xt / Fizz Buzz
Created August 5, 2014 09:04
Fizz Buzz
var fs = require("fs");
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (line) {
var myArray = line.split(" "),
output = new Array()
for (var i=1; i<=myArray[2];i++) {
if (i % myArray[0] == 0) {
if (i % myArray[1] == 0) {
output.push("FB")
} else {