Skip to content

Instantly share code, notes, and snippets.

Avatar

Jack Rugile jackrugile

View GitHub Profile
@jackrugile
jackrugile / jacks-first-custom-pc.md
Last active Apr 1, 2020
Some notes about my experience building my first custom PC.
View jacks-first-custom-pc.md

Jack's First Custom PC

I've been wanting to build my own custom PC since high school, and I finally did it. It was always intimidating to me because it seemed so complicated and easy to mess up. I was afraid of buying incompatible parts, or putting them together in the wrong way.

I grew up playing PC games more so than console, but over the last few years, I've been mainly on PS4. I'm a huge fan of Overwatch by Blizzard, and I've been playing that a ton on console. I wanted to give it a try on PC, so that rekindled my interest in building my own machine.

Overwatch doesn't have insane system requirements, but I still wanted it to run smooth, so I tried to find the perfect balance between performance and budget. The nice thing about PC parts is that the prices seem to dramatically go down if you're willing to get slightly older parts (1-2 years old). Buying the newest and shiniest would have been overkill for me, and it would have overkilled my bank account.

After reading enough articles and watching enou

@jackrugile
jackrugile / vue-inline-svg-loader.md
Last active Aug 30, 2018
Instructions for loading SVGs inline from a file reference in Vue.js
View vue-inline-svg-loader.md

Install svg-inline-loader

npm install svg-inline-loader --save-dev

Webpack Config

In module rules in webpack config, add this loader:

@jackrugile
jackrugile / calc.js
Last active Jan 8, 2019
Some common calculation helpers I use in a lot of my demos and games.
View calc.js
class Calc {
/*
------------------------------------------
| rand:float - returns random float
|
| min:number - minimum value
| max:number - maximum value
|
| Get a random float between two values
@jackrugile
jackrugile / setLimitedInterval.js
Last active Oct 9, 2017
A helper function that is the same as setInterval(), but with a limit parameter.
View setLimitedInterval.js
function setLimitedInterval(func, delay, limit) {
let i = 0;
let interval = setInterval(() => {
func(i);
if(++i >= limit) clearInterval(interval);
}, delay);
return interval;
}
// Example: console.log() the current iteration number 3 times, every second
@jackrugile
jackrugile / SubdivisionModifier.js
Created Jun 5, 2017
Three.js Subdivision Modifier with option to retain original shape
View SubdivisionModifier.js
/*
* @author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog
* @author centerionware / http://www.centerionware.com
*
* Subdivision Geometry Modifier
* using Loop Subdivision Scheme
*
* References:
* http://graphics.stanford.edu/~mdfisher/subdivision.html
* http://www.holmes3d.net/graphics/subdivision/
@jackrugile
jackrugile / index.js
Last active Mar 8, 2017
Normalize center transform-origin cross-browser issue
View index.js
function centerTransformOrigin(elems) {
for(let i = 0; i < elems.length; i++) {
let bcr = elems[i].getBBox();
elems[i].style.transformOrigin = `${bcr.x + bcr.width / 2}px ${bcr.y + bcr.height / 2}px`;
}
}
@jackrugile
jackrugile / canvas-blurred-rect.js
Last active Nov 5, 2016
Create contained blurred rectangle with HTML 5 canvas
View canvas-blurred-rect.js
function blurredRect( w, h, blur, color ) {
let c = document.createElement( 'canvas' );
let ctx = c.getContext( '2d' );
c.width = w;
c.height = h;
ctx.fillStyle = color;
ctx.shadowBlur = blur;
ctx.shadowColor = color;
ctx.shadowOffsetX = w;
ctx.shadowOffsetY = h;
View keybase.md

Keybase proof

I hereby claim:

  • I am jackrugile on github.
  • I am jackrugile (https://keybase.io/jackrugile) on keybase.
  • I have a public key whose fingerprint is 3587 DA94 7B25 D76A E723 5757 05BF ACC4 A7AC 936C

To claim this, I am signing this object:

View gulpfile.js
gulp.task( 'fonts', function() {
gulp.src('src/fnt/**/*')
.pipe( gulp.dest( dest + 'fnt' ) );
});
gulp.task('watch', function() {
gulp.watch( 'src/fnt/**/*', [ 'fonts' ] );
});
View glc1.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(2.5);
glc.setFPS(60);
glc.setMode('bounce');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,