Skip to content

Instantly share code, notes, and snippets.

View drawcode's full-sized avatar
😎
Shipping product

Ryan Christensen drawcode

😎
Shipping product
View GitHub Profile
@drawcode
drawcode / IIS APPPOOL\[apppool]
Created November 9, 2015 18:26
Adding rights for apppool .NET
IIS APPPOOL\{app pool name}
@drawcode
drawcode / TokenValidator.cs
Created October 23, 2015 01:12 — forked from anonymous/TokenValidator.cs
Validate JSON Web Token (JWT) With .NET JWT Library
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IdentityModel.Tokens;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Text;
<html lang="en"><head>
<title>Video Texture (Three.js)</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/base.css">
<style type="text/css"></style></head>
<body>
<script src="js/Three.js"></script>
<script src="js/Detector.js"></script>
// setting up the renderer
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
var container = document.createElement('div');
document.body.appendChild( container );
container.appendChild( renderer.domElement );
// creating a new scene
// SCENE
scene = new THREE.Scene();
@drawcode
drawcode / threevideodemo.js
Created October 8, 2015 00:47 — forked from ErikPeterson/threevideodemo.js
THREEJS Video Texture Demo
//Set up scene, camera, and renderer
var scene = new THREE.Scene;
var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
var renderer = new THREE.CanvasRenderer();
renderer.setClearColor( 0xf0f0f0 );
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var video = document.createElement('video');
Shader "Custom/Outline2" {
Properties {
_MainColor ("Diffuse Color", Color) = (1,1,1,1)
_MainTex ("Base layer (RGB)", 2D) = "white" {}
_Dist ("Shift", Range(-1, 1)) = 0
}
SubShader {
Buy and start creating SSL certificate on GoDaddy
Create Certificate signing request (CSR): openssl req -new -newkey rsa:2048 -nodes -keyout www.mydomain.com.key -out www.mydomain.com.csr. Leave the challenge password empty because GoDaddy cannot handle that.
Open the www.mydomain.com.csr with an Editor and copy and paste everything into GoDaddy's request form.
Wait and continue with the process until everything is accepted. (There is a status page, you should bookmark it and visit it occasionally to check the progress.)
Export certificate for IIS, now you should get a .p7b file and a .crt file
Use OpenSSL to create the pfx file:
the spec is pretty straight forward.
At a high level this is what you will need to do to support AuthCode grant pattern :
Assuming: Your application own the users.
Issue clientid/secrets to each of the 3rd Party applications.
On your server create end points for
/oauth/authorize
/oauth/token
@drawcode
drawcode / slots.coffee
Last active August 29, 2015 14:27 — forked from leemartin/slots.coffee
CSS3 Slot Machine
$ ->
result = []
count = 0
# Loop through each reel
$('.reel-outer'). each ->
$this = $(this)
index = $this.index()
spinPlus = 0
using OfficeOpenXml;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace WebUI.Infrastructure
{
public static class StringUtils
{
private static string DuplicateTicksForSql(this string s)