Skip to content

Instantly share code, notes, and snippets.

View ctolkien's full-sized avatar
👋

Chad Tolkien ctolkien

👋
View GitHub Profile
@ctolkien
ctolkien / gist:2b30bde7930e8f1dddeb
Created October 12, 2015 06:27
Surface Pro vs Surface Book
Surface Pro: 256GB, I7, Iris Pro graphics (decent), 16GB - $2800 (+Keyboard $200, $3K total)
Surface Book: 256GB, I5, 520 graphics (shit) + dedicated gpu (good), 8GB - $2950
Surface Book: 512GB, I7, 520 graphics (shit) + dedicated gpu (good), 16gb - $4200
• SP is half the weight, 768gms vs 1516grams. The keyboard for SP will add another 310 grams, bringing the total to 1078g
• Battery life SP is 12 hours, SB is 9 hours(base) + 3 hours (tablet) (12 when combined)
• SB only has ports in the base, means no streaming XBone to SB from bed (can't attached controller)
• There is no SB 16GB with 256gb HDD.
@ctolkien
ctolkien / touch.ps1
Created September 7, 2015 01:23
Touch
function Touch
{
param([Parameter(Mandatory=$true, ValueFromPipeline=$true)][System.IO.FileInfo]$file)
$file.LastWriteTime = date
}
@ctolkien
ctolkien / gist:d99a18f07e95b7cb5a04
Created June 17, 2015 02:15
element in viewpot
function elementInViewport(el) {
var r, html;
if (!el || 1 !== el.nodeType) { return false; }
html = document.documentElement;
r = el.getBoundingClientRect();
return (!!r
&& r.bottom >= 0
&& r.right >= 0
&& r.top <= html.clientHeight
@ctolkien
ctolkien / gist:719c6ce5861c9155289c
Created June 3, 2015 13:00
ASP.Net 5 Gulp + Webpack
var gulp = require('gulp');
var webpack = require('gulp-webpack');
var ts = require('gulp-typescript');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var dnx = require("gulp-dnx");
gulp.task('webpack', function(){
return gulp.src('./src/client/main.ts')
.pipe(webpack({
output:{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
NAME
New-Service
SYNOPSIS
Creates a new Windows service.
SYNTAX
New-Service [-Name] <String> [-BinaryPathName] <String> [-Credential
<PSCredential>] [-DependsOn <String[]>] [-Description <String>]
@ctolkien
ctolkien / gulpfile.js
Created March 4, 2015 06:16
asp.net 5 gulpfile
var gulp = require('gulp');
var bower = require('gulp-bower');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var aspnetk = require("gulp-aspnet-k");
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
var gutil = require('gulp-util');
var plumber = require('gulp-plumber');
var colors = require('colors');
{
"name": "WebApplication",
"private": true,
"dependencies": {
"bootstrap": "3.0.0",
"jquery": "1.10.2",
"jquery-validation": "1.11.1",
"jquery-validation-unobtrusive": "3.2.2",
"hammer.js": "2.0.4",
"bootstrap-touch-carousel": "0.8.0"