Skip to content

Instantly share code, notes, and snippets.

@poeticninja
poeticninja / index.html
Created October 28, 2014 14:32
base64 to file blob, very basic example.
<!doctype html>
<html>
<head>
<title>File Upload Page</title>
</head>
<body>
<h1 onClick="sendFormData()">Send it!</h1>
<script type="text/javascript">
@poeticninja
poeticninja / generate-uuid.js
Last active June 5, 2019 20:09
GenerateUUID
function generateUUID(n) {
return n ? (n ^ 16 * Math.random() >> n / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, generateUUID)
}
@poeticninja
poeticninja / link-fancy-underline.css
Created October 4, 2018 14:47
Fancy Link Underline Animation
@poeticninja
poeticninja / business-planning.md
Last active August 1, 2018 18:16
Business Planning

Vision

Big picture idea of what you want to achieve.

Mission Statement

General statement of how you will achieve your vision. There is a very close relationship between the vision and mission. The mission is an action statement that usually begins with the word “to”. Once again it is a very simple and direct statement that is easy to understand and remember.

Core Values

Core values define the business in terms of the principles and values that the business leaders will follow. They provide the bounds or limits of how the business leaders will conduct their activities while carrying out the vision and mission.

Goals

@poeticninja
poeticninja / test.js
Created May 20, 2014 14:59
Simple example of chai and selenium webdriver for node.js.
// Require chai.js expect module for assertions
var chai = require('chai');
var expect = require('chai').expect;
// Application Server
var serverUri = '0.0.0.0:3000';
// Official selenium webdriver testing setup
var webdriver = require('selenium-webdriver');
@poeticninja
poeticninja / .bash_profile
Created October 11, 2016 19:10
Bash Profile - 10/11/2016
# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias cd..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias -- -="cd -"
## Use a long listing format ##
alias ll='ls -la'
@poeticninja
poeticninja / promise.serial.waterfall.js
Created May 10, 2017 20:00
Example serial promises with error to handle individual cases.
const delay = require("delay");
const people = [
{
id: 0,
name: "Stewie",
delay: 200
},
{
id: 1,
@poeticninja
poeticninja / docker-cache-experimental.sh
Created October 7, 2016 18:54
docker cache experimental semaphore
#!/usr/bin/env bash
image_archive="image-archive.tar"
image_metadata="docker-image-metadata.tar.gz"
function cache_images() {
images_to_cache=$(docker images | awk '{print $3}' | grep -v '<none>' | tail -n +2 | while read line; do docker history -q $line | grep -v '<missing>'; done | uniq)
if [ -n "$images_to_cache" ]; then
printf "Saving the following images:\n$images_to_cache\n\n"
@poeticninja
poeticninja / ComponentWidth.js
Last active March 21, 2017 23:44
React component width decorator.
import React from "react";
import elementResizeEvent from "element-resize-event";
export default (Component) => {
class ComponentWidth extends React.Component {
state = {
width: 0,
};
componentDidMount() {
const element = this.targetElement;
@poeticninja
poeticninja / _spacing.scss
Last active February 24, 2017 22:55
Spacing for styles
@mixin spacing($prop: padding, $dir: top, $value: 1) {
#{$prop}-#{$dir}: $value;
}
@function initial($string) {
@return str-slice($string, 0, 1);
}
$properties: (
margin,