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 / multiply.py
Created December 20, 2014 05:11
Multiply in python
def multiply(a, b):
return a*b
@P1xt
P1xt / Jeff's blog 2 - style the header with CSS
Created January 9, 2015 18:15
Jeff's blog 2 - style the header with CSS
Slide 1
Jeff’s Blog
Part2: Header CSS
Slide 2
Our Mission:
In this less, we’ll cover 3 main things
Add a CSS reset external CSS file
Style the navigation lins
Style the rest of the header
@P1xt
P1xt / Jeff's Blog 3 - Responsive design & Javascript
Created January 9, 2015 20:02
Jeff's Blog 3 - Responsive design & Javascript
Slide 1:
Jeff's blog
Part 3: Responsive design & Javascript
Slide 2:
Our Mission:
In this lesson, we'll cover three main things:
1. Give the content a responsive design
2. Learn about advance colors
@P1xt
P1xt / Build your own blog theme
Created January 9, 2015 20:10
Build your own blog theme
Slide 1:
Build your own blog theme
Slide 2:
Now tat you've made an awesome theme for Jeff's blog,
let's see if you can make one on your own,
without any guidance!
Slide 3:
It'll be hard to remember how to do some things,
@P1xt
P1xt / index.jade
Created February 1, 2015 21:52
Layout for a quick bootstrap page to drop a Phaser game into
extends layout
block content
h1= title
@P1xt
P1xt / Grid-of-green-tiles,-with-diagonals-in-red.markdown
Created March 27, 2015 03:51
Grid of green tiles, with diagonals in red

Grid of green tiles, with diagonals in red

Usually you see jQuery pulled in to manipulate the DOM. This is a Proof of Concept, drawing the grid exclusively by dynamically adding DOM elements on page load with JavaScript (using plain JS, no jQuery or other "helpers"). Clicking on a grid element will cause it to disappear, this is accomplished via a click handler which toggles the element's background style off onclick.

A Pen by P1xt on CodePen.

License.

@P1xt
P1xt / diff.js
Last active November 21, 2015 05:07
Javascript function to return an array containing the items that occur in one but not both input arrays. Need to refactor this.
/**
* diff two arrays - return the elements that occur in one but not both input arrays
* note to self: This works but there has to be a better (more performant) solution
* Revisit this and look into removing items from both arrays as they're discovered
**/
function diff(arr1, arr2) {
// get the items from arr1 that aren't in arr2
var filteredArr1 = arr1.filter( function( el ) {
return arr2.indexOf( el ) < 0;
} );
@P1xt
P1xt / bonfire-exact-change.js
Created December 9, 2015 18:10 — forked from anonymous/bonfire-exact-change.js
http://www.freecodecamp.com/p1xt 's solution for Bonfire: Exact Change
// Bonfire: Exact Change
// Author: @p1xt
// Challenge: http://www.freecodecamp.com/challenges/bonfire-exact-change
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function drawer(price, cash, cid) {
var change = [];
var types = ['PENNY',
'NICKEL',
'DIME',
@P1xt
P1xt / mark.pipe.ts
Last active March 13, 2017 18:10
Angular 2 pipe to use the marked npm package to convert markdown
import { Pipe, PipeTransform } from '@angular/core';
var marked = require('marked');
@Pipe({
name: 'mark'
})
export class MarkPipe implements PipeTransform {
transform(value: any, args?: any): any {
marked.setOptions({ sanitize: true});