Skip to content

Instantly share code, notes, and snippets.

View chriswitko's full-sized avatar

Chris Witko chriswitko

View GitHub Profile
@chriswitko
chriswitko / Random-string
Created March 3, 2020 04:25 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@chriswitko
chriswitko / string-utils.js
Created December 2, 2019 10:46 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str) {
return str.toLowerCase();
@chriswitko
chriswitko / stackCreateElementRenderer.jsx
Created October 9, 2019 08:16 — forked from jamesseanwright/stackCreateElementRenderer.jsx
Toy stack-based HTML renderer with React.createElement-compliant element creator
'use strict';
const indentWidth = 2;
const selfClosingElements = [
'meta',
'link',
];
const indent = (string, depth) =>
@chriswitko
chriswitko / index.html
Created September 29, 2019 18:51 — forked from simplesessions/index.html
Recreating the SIRI icon with no images or javascript. Four HTML elements have been used so far and the CSS is very messy. I hope to clean this up in the future. This will be an on-going build.
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Source+Code+Pro:200,300" media="screen">
<div id="siri">
<div id="spin"></div>
<a id="icon">
<span class="highlights"></span>
</a>
</div>
@chriswitko
chriswitko / index.js
Created August 22, 2019 11:54 — forked from jbesw/index.js
Language translation with S3 and AWS Translate
/*
MIT No Attribution
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so.
const msg = 'hello'
console.log(msg)
'use strict';
// Dependencies
const gcloud = require('google-cloud', {
projectId: 'sara-bigquery',
keyfileName: 'keyfile.json'
});
const vision = gcloud.vision();
const fs = require('fs');
const async = require('async');
@chriswitko
chriswitko / HODL.sol
Created January 12, 2018 21:15 — forked from anonymous/HODL.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-latest.js&optimize=false&gist=
pragma solidity ^0.4.19;
/**
@title HODL
A smart contract for real HOLDERS, all ETH received here can be withdraw a year
after it was deposited.
*/
contract HODL {
@chriswitko
chriswitko / tryEthereum.js
Created January 9, 2018 15:07 — forked from qx133/tryEthereum.js
Try out Ethereum using only nodejs and npm!
var Web3 = require('web3');
var util = require('ethereumjs-util');
var tx = require('ethereumjs-tx');
var lightwallet = require('eth-lightwallet');
var txutils = lightwallet.txutils;
var web3 = new Web3(
new Web3.providers.HttpProvider('https://rinkeby.infura.io/')
);
var address = '0x8D68583e625CAaE969fA9249502E105a21435EbF';
var key = '1ce642301e680f60227b9d8ffecad474f15155b6d8f8a2cb6bde8e85c8a4809a';
@chriswitko
chriswitko / walk.go
Created December 6, 2017 16:52 — forked from tdegrunt/walk.go
Replace some text in a bunch of files with golang
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)