Skip to content

Instantly share code, notes, and snippets.

@hagb4rd
hagb4rd / code.cpp
Created January 7, 2019 18:03 — forked from d7samurai/.readme.md
minimal d3d11 by d7samurai
// minimal d3d11 reference implementation; an uncluttered direct3d 11 setup and rendering primer for newcomers to the api.
// complete, runnable c+ application contained in a single function (winmain) and laid out in a step-by-step fashion that
// should be easy to follow from the code alone. win7 compatible. produces this output: https://youtu.be/XR7zPheek2Q
#pragma comment(lib, "d3d11")
#pragma comment(lib, "d3dcompiler")
#include <windows.h>
#include <d3d11_1.h>
@hagb4rd
hagb4rd / EasingFunctions.json
Created August 25, 2018 10:09 — forked from gre/EasingFunctions.json
DEPRECATED Please use http://github.com/gre/bezier-easing for latest vrrsion.
{
"ease": [0.25, 0.1, 0.25, 1.0],
"linear": [0.00, 0.0, 1.00, 1.0],
"ease-in": [0.42, 0.0, 1.00, 1.0],
"ease-out": [0.00, 0.0, 0.58, 1.0],
"ease-in-out": [0.42, 0.0, 0.58, 1.0]
}
@hagb4rd
hagb4rd / jQuery4.js
Last active August 11, 2018 14:44 — forked from caub/jQuery4.js
v4.1
function $(container, selector) {
const els =
typeof selector === 'string'
? container.querySelectorAll(selector)
: typeof container === 'string' ? document.querySelectorAll(container) : [container];
const fns = {
removeClass(...cls) {
els.forEach(el => {
el.classList.remove(...cls);
@hagb4rd
hagb4rd / _readme.md
Created May 12, 2018 21:24 — forked from shime/_readme.md
github oauth in node using express

What?

Most basic example of authenticating with Github in node.

How?

Clone this gist, change keys inside config.js and then hit npm install && node app.js.

Done?

@hagb4rd
hagb4rd / MountVHD.cmd
Created February 19, 2018 20:03 — forked from nicjansma/MountVHD.cmd
MountVHD and UnMountVHD: Allows you to mount .VHDs in Windows 7 from the command-line. http://nicj.net/2012/01/04/mounting-vhds-in-windows-7-from-a-command-line-script
@echo off
setlocal enabledelayedexpansion
if {%1}=={} (
echo Usage: %~nx0 [vhd] [letter]
exit /b 1
)
set vhdPath=%~dpnx1
set driveLetter=%2
@hagb4rd
hagb4rd / wvdial.conf
Last active December 14, 2017 15:15 — forked from anonymous/wvdial.conf
[Dialer Defaults]
;Init1 = ATZ
;Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
;Modem Type = Analog Modem
;Baud = 9600
New PPPD = yes
;Modem = /dev/ttyUSB0
;ISDN = 0
; Phone = <Target Phone Number>
; Password = <Your Password>
@hagb4rd
hagb4rd / getting-started.md
Created December 4, 2017 21:25 — forked from joepie91/getting-started.md
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. _Get out there and build things!

// ==UserScript==
// @name LE
// @namespace http://your.homepage/
// @version 0.1
// @description LE
// @author You
// @match http://tampermonkey.net/empty.html
// @grant unsafeWindow
// ==/UserScript==
@hagb4rd
hagb4rd / gist:53a44ac71dd25d2fbe2f4f9fbaaccb81
Created December 29, 2016 14:39 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@hagb4rd
hagb4rd / what-forces-layout.md
Created August 10, 2016 04:28 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()