Skip to content

Instantly share code, notes, and snippets.

View kyleparisi's full-sized avatar

Kyle Parisi kyleparisi

  • Newtown, PA
View GitHub Profile
@kyleparisi
kyleparisi / Kyle's Data Science.md
Last active August 30, 2016 16:39
Self exploration of data science

Kyle's Data Science

tl;dr: don't setup locally, skip to Q/A...

Setup spark on local (with ipython)

gist

brew install apache-spark
<html>
<head>
</head>
<body>
</body>
</html>
@kyleparisi
kyleparisi / Drag.js
Last active January 2, 2019 13:21
A single script to handle dragging of html or svg elements
try {
if (document) {
}
} catch (e) {
throw new Error("Drag module only works in browsers");
}
const Drag = function(view) {
let documentation = `
# Usage
@kyleparisi
kyleparisi / xml-to-tsv.php
Last active November 14, 2016 13:29
This php script takes a local xml file input and stdouts the equivalent tsv.
<?php
/**
* This php script takes a local xml file input and stdouts the equivalent csv.
*/
$shortopts = "";
$shortopts .= "f:"; // Required value
$options = getopt($shortopts);
if (count($options) === 0) {
@kyleparisi
kyleparisi / lindy.js
Last active February 8, 2022 02:04
A basic function to create dom elements (lindy.js)
// signatures
// (root)
// (root, inner)
// (root, {})
// (root, {}, inner)
// inner = '' || [] - array can have text or html els
// {} = options i.e. onclick, class, id, etc.
var signatures = {
1: function(root) {
@kyleparisi
kyleparisi / stuff.sh
Created December 29, 2016 17:32
Debugging stuff
# Debug tcp requests and respond with 200
socat -v TCP-LISTEN:3000 "exec:printf \'HTTP/1.0 200 OK\r\n\r\n\'"
@kyleparisi
kyleparisi / date_looper.sh
Created January 20, 2017 18:15
Bash script that loops over dates for other atomic scripts
#!/bin/bash
# On linux use date, on mac gdate [via `brew install coreutils`].
# Will run from oldest date to today.
# $ sh date_looper.sh '2016-12-10'
currentdate=$1
loopenddate=$(gdate --date "$2 1 day" +%Y-%m-%d)
until [ "$currentdate" == "$loopenddate" ]
do
echo $currentdate
@kyleparisi
kyleparisi / index.js
Created February 9, 2017 14:23
Prototype of how to use lindy in a reactive setting (lindy modified slightly)
let init = lindy('h3', `Service running - false`);
let start = function () {
return lindy('button', {
onclick: () => this.emit('running', true)
}, 'Start Service');
};
let stop = function () {
return lindy('button', {
@kyleparisi
kyleparisi / index.html
Last active February 14, 2017 16:46
Electron starter
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
@kyleparisi
kyleparisi / brie.css
Created February 14, 2017 19:23
My go to set of sytles
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif;
}
.container {