Skip to content

Instantly share code, notes, and snippets.

View taylorsmithgg's full-sized avatar

Taylor Smith taylorsmithgg

  • Independent
  • United States
View GitHub Profile
<html>
<head></head>
<body>
<div id="pieChart"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js"></script>
<script src="https://github.com/benkeen/d3pie/blob/master/d3pie-source/d3pie-source.js"></script>
<script>
var pie = new d3pie("pieChart", {
import java.lang.reflect.Array;
import java.util.Scanner;
import java.util.Arrays;
class scratch_10{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] numbers = scanner.nextLine().split(" ");
String[] result = (String[]) Array.newInstance(String.class, numbers.length + 1);
System.arraycopy(numbers, 0, result, 0, numbers.length);
import java.io.IOException;
import java.util.Scanner;
/**
Write a description of class Game here.
@author (your name)
@version (a version number or a date)
*/
public class Game
{
@taylorsmithgg
taylorsmithgg / gulpfile.babel.js
Created April 21, 2017 17:26
Simple Gulp for Babel, Gulp, and Elastic Beanstalk
'use strict'
const gulp = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin');
const sourcemaps = require('gulp-sourcemaps');
const del = require('del');
const gutil = require('gulp-util');
const babel = require('gulp-babel');
@taylorsmithgg
taylorsmithgg / main.rs
Last active April 23, 2017 09:05
Rust 1.16.0 ? Operator Issue On Result
use std::io;
use std::io::prelude::*;
use std::fs::File;
// error[E0277]: the trait bound `(): std::ops::Carrier` is not satisfied
// --> src/main.rs:43:17
// |
// 43 | let mut f = File::open("foo.txt")?;
// | ----------------------
// | |
@taylorsmithgg
taylorsmithgg / main.rs
Created April 23, 2017 12:51
Save and load from binary in Rust
fn write_binary(vector: Vec<u8>) -> Result<(), std::io::Error> {
let mut f = OpenOptions::new()
.create(true)
.write(true)
.read(true)
.open("foo.bin")
.unwrap();
println!("The file: {:?}", f);
// https://github.com/taylorsmithgg
// A few code snippets from a current CMS project that I am developing for Detroit Labs that showcase using Angular
// to interact with RESTful services to populate a map dynamically.
// In lieu of Express, I am currently using Meteor, which supports 3-way data bindings.
// I am also using Angular Material for its directives and Babel for polyfill support
$scope.$on('mapInitialized', function(event, evtMap) {
map = evtMap;
map.singleInfoWindow = true;
import java.util.Scanner;
class CalculateTuition {
public static void main(String[] args) {
int tuition = 0;
System.out.println("How many total hours are you taking?");
Scanner scanner = new Scanner(System.in);
int creditHour = Integer.parseInt(scanner.nextLine());
if(creditHour > 0){
Single value
(?<=webSecurityToken":")(?:[^\\"]+|\\.)*
All key, value pairs
(?!":")([^\\":,]+|\\.)
Email Validation
.+@.+\..+[^.]
@taylorsmithgg
taylorsmithgg / byteme.sh
Created July 12, 2017 01:56 — forked from todd-dsm/byteme.sh
byteMe
#------------------------------------------------------------------------------
# PUPOSE: Function: Divides by 2^10 until < 1024 and then append metric suffix
# AUTHOR: Joe Negron - LOGIC Wizards ~ NYC
# LICENSE: BuyMe-a-Drinkware: Dual BSD or GPL (pick one)
# USAGE: byteMe (bytes)
# ABSTRACT: Converts a numeric parameter to a human readable format.
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------