Skip to content

Instantly share code, notes, and snippets.

View petermikitsh's full-sized avatar
🏳️‍🌈

Peter Mikitsh petermikitsh

🏳️‍🌈
View GitHub Profile
//
// Rasterizer.java
//
//
// Created by Joe Geigel on 1/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
/**
*
@petermikitsh
petermikitsh / server.js
Created December 25, 2015 05:39
simple nodejs server for cpu, i/o benchmarking
#!/usr/bin/env node
// to run: `node server.js` or `./server.js`
var crypto = require("crypto"),
fs = require('fs'),
http = require("http");
function fibonacci (n) {
if (n < 2) {
@petermikitsh
petermikitsh / server.js
Last active November 2, 2016 23:50
Cairo brew install formula
class Cairo < Formula
desc "Vector graphics library with cross-device output support"
homepage "https://cairographics.org/"
url "https://cairographics.org/releases/cairo-1.14.6.tar.xz"
mirror "https://www.mirrorservice.org/sites/ftp.netbsd.org/pub/pkgsrc/distfiles/cairo-1.14.6.tar.xz"
sha256 "613cb38447b76a93ff7235e17acd55a78b52ea84a9df128c3f2257f8eaa7b252"
revision 1
bottle do
sha256 "88383b86fdf914d59dcf249403d7358ff3bcc84098186dd10a58fbb1da07d98d" => :sierra
@petermikitsh
petermikitsh / DOMUtils.js
Created December 13, 2016 23:16
Utility functions for inspecting various DOM characteristics
// Find the height of the deepest DOM node
function getHeight(node) {
var children = node.children;
if (children.length === 0) {
return 1;
} else {
var childHeights = Array.from(children).map(function (child) {
return getHeight(child);
});
return 1 + Math.max.apply(null, childHeights);
@petermikitsh
petermikitsh / keybase.md
Created February 28, 2017 02:20
keybase.md

Keybase proof

I hereby claim:

  • I am petermikitsh on github.
  • I am petermikitsh (https://keybase.io/petermikitsh) on keybase.
  • I have a public key ASAqwMNwoRSaTkH2qQHqmaFYJsmo3F77EghGYGYT6c5f5wo

To claim this, I am signing this object:

@petermikitsh
petermikitsh / .eslintrc
Created February 28, 2017 17:35
linter config
// AirBNB Linting Rules
// See more @ https://gist.github.com/nkbt/9efd4facb391edbf8048
{
"env": {
"browser": true,
"node": true,
"es6": true
},
@petermikitsh
petermikitsh / index.js
Created December 28, 2017 23:13
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
var timm = require('timm');
var obj = {foo: ''};
var newObj = timm.setIn(obj, ['foo', 'bar'], 'baz');
console.log('the object is', newObj);
@petermikitsh
petermikitsh / email.rb
Created January 1, 2014 22:06
PA DMV License Exam E-mail Notifier
# Provide the approriate server, port, from, username, and password fields.
# Author: Peter Mikitsh
require 'net/smtp'
def send_email(to, opts={})
opts[:server] ||= '' # SMTP SERVER
opts[:port] ||= 587 # PORT: DEFAULT IS 587
opts[:from] ||= '' # 'FROM' E-MAIL FIELD
(
function() {
const lagRadar = ( config = {} ) => {
const {
frames = 50,
speed = 0.0017,
size = 300,
inset = 3,
parent = document.body,
} = config;
@petermikitsh
petermikitsh / client_code.js
Last active December 6, 2019 16:18
SAML implementation for feathers.js
/* SAML Authentication Flow
* - Open GET /SSO/SAML2 in an iframe
* - this will redirect to the identity provider ("IdP")
* - The user will insert their credentials in the IdP's website
* - The IdP will redirect to POST /SSO/SAML2
* - The response is validated
* - A user is created (should check if it exists first)
* - Set the JWT cookie
* - Send HTML response to instruct parent window to close the iframe
*/