Skip to content

Instantly share code, notes, and snippets.

{"count": 20, "fitness_disciplines": [{"id": "walking", "name": "Walking"}, {"id": "strength", "name": "Strength"}, {"id": "cycling", "name": "Cycling"}, {"id": "stretching", "name": "Stretching"}, {"id": "running", "name": "Running"}, {"id": "beyond_the_ride", "name": "Floor"}, {"id": "circuit", "name": "Bootcamp"}, {"id": "yoga", "name": "Yoga"}, {"id": "meditation", "name": "Meditation"}, {"id": "cardio", "name": "Cardio"}], "rides": [{"scheduled_start_time": 1565883000, "rating": 0, "difficulty_rating_avg": 0.0, "equipment_tags": [], "difficulty_rating_count": 0, "captions": [], "title": "30 min Power Zone Ride", "is_explicit": false, "live_stream_id": "e571d20a9efc4e34a75a8bb3924acfd7-live", "origin_locale": "en-US", "difficulty_estimate": null, "content_format": "video", "location": "nyc", "original_air_time": 1565882340, "has_closed_captions": false, "pedaling_duration": 1800, "sample_vod_stream_url": null, "extra_images": [], "series_id": "9fde039566054ea499130bed1c289eb3", "studio_peloton_id": "7812b
@nickarthur
nickarthur / UnityAssetBundleBuilder.cs
Created November 21, 2019 20:45 — forked from tkyaji/UnityAssetBundleBuilder.cs
[Unity] Build Asset Bundle, and upload to AWS-S3
using UnityEngine;
using UnityEngine.Networking;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System;
@nickarthur
nickarthur / UI-Fast-Default
Created May 21, 2019 16:40 — forked from ArturoNereu/UI-Fast-Default
A simpler version of the UI Shader for mobile and low spec devices
Shader "UI/Fast-Default"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
}
SubShader
{
@nickarthur
nickarthur / BareBoneShader.shader
Created May 21, 2019 16:37 — forked from ArturoNereu/BareBoneShader.shader
The basic shader for Unity. A template to make more advanced ones.
Shader "CustomShaders/BareBoneShader"
{
//Properties
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
}
//Subshaders
SubShader
@nickarthur
nickarthur / encryption.js
Created March 28, 2019 06:59 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv);
@nickarthur
nickarthur / bytestokey.js
Created March 28, 2019 06:33 — forked from bnoordhuis/bytestokey.js
Compute key+IV from passphrase (createCipher to createCipheriv migration script)
// Copyright (c) 2017, Ben Noordhuis <info@bnoordhuis.nl>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@nickarthur
nickarthur / RSSFeed.swift
Created March 13, 2019 21:25 — forked from kharrison/RSSFeed.swift
Swift Decodable With Multiple Custom Dates
import Foundation
extension DateFormatter {
static let iso8601Full: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.locale = Locale(identifier: "en_US_POSIX")
return formatter
//
// Plane.swift
// TextAR
//
// Created by Arvind Ravi on 23/08/17.
// Copyright © 2017 Arvind Ravi. All rights reserved.
//
import Foundation
import ARKit
@nickarthur
nickarthur / LockingWithSwiftAndGCD.swift
Created February 19, 2019 10:14 — forked from drosenstark/LockingWithSwiftAndGCD.swift
Locking Demo with GCD and Swift (Playground)
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
// CHANGE THIS TO TRUE FOR the lock queue to be used
let useLocks = false
var counter : Int = 0
@nickarthur
nickarthur / access1.swift
Created February 5, 2019 22:01 — forked from mildocjr/access1.swift
access-1
public class myClass {
}
// the public keyword defines the access control for this class