This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/p5.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/addons/p5.dom.min.js"></script> | |
</head> | |
<body> | |
<script src="template.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var touch = false; | |
function setup(){ | |
createCanvas(640, 640); | |
} | |
function draw(){ | |
if(touch){ | |
fill(255, 0, 0); | |
rect(mouseX, mouseY, 20, 20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Particle(x, y, color){ | |
this.pos = createVector(x + random(-10, 10), y + random(-10, 10)); | |
this.vel = createVector(floor(random(-1, 1))*noise(this.pos.x), -noise(this.pos.y)*7); | |
this.alpha = 255; | |
this.r = random(170, 255); | |
this.g = random(10, 255); | |
this.b = random(0, 100); | |
this.update = function(){ | |
this.pos.add(this.vel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Normal JavaScript Code | |
const arr = [1, 2, 3, 4, 5]; | |
for(let i = 0; i < arr.length; i++){ | |
console.log(arr[i]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let critical = require('critical'); | |
critical.generate({ | |
base: 'test/', | |
src: 'index.html', | |
dest: 'styles/main.css', | |
dimensions: [{ | |
height: 200, | |
width: 500 | |
}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen and (min-width: 600px) { | |
background-image: url('supercoolimages/dog-small.png'); | |
} | |
@media only screen and (min-width: 992px) { | |
background-image: url('supercoolimages/dog-big.png'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let todos = { | |
todoArray: [ | |
{ | |
todo: 'Learn more ReactJS, GatbsyJS and Meteor', | |
timeFrame: 'As long as is needed', | |
priority: 'HIGH', | |
tag: 'Web Development' | |
}, | |
{ | |
todo: 'Deep dive into Tensorflow and Machine Learning', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Minified Code - A 22.83% Compression saving 0.02kB | |
const arr=[1,2,3,4,5];for(let a=0;a<arr.length;a++)console.log(arr[a]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connecting to the Kaggle Pitchfork Database | |
import sqlite3 as sql | |
import numpy as np | |
db = sql.connect('../../data/pitchfork.sqlite') | |
cursor = db.cursor() | |
artist_dict = {} | |
artist_lookup = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
genres = {} | |
genre_lookup = {} | |
scores = {} | |
cursor.execute('select distinct genre from genres') | |
for row in cursor: | |
genre_lookup[len(genre_lookup)] = row[0] | |
genres[row[0]] = [] | |
for i in range(11): | |
scores[i] = [] |
OlderNewer