Skip to content

Instantly share code, notes, and snippets.

@steviecs
steviecs / gradient-obj.js
Created February 24, 2023 19:48
gradient-obj.js
/*
* Stripe WebGl Gradient Animation by Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
*
* Taken from: https://kevinhufnagl.com/how-to-stripe-website-gradient-effect/
* See also: https://codepen.io/smitpatelx/pen/GRZayyO
*/
// Converting colors to proper format
@notlion
notlion / obj.js
Created August 5, 2011 13:01
Plask OBJ Loader
// Based on Dean McNamee's OBJ loader
// Modified to output triangles with texture coords
function loadOBJ(filename){
var filedata = fs.readFileSync(filename, 'utf8');
var lines = filedata.split('\n');
var tris = [ ];
var v = [ null, ]; // Verts, indexed from 1, so put in a filler.
@HikariKnight
HikariKnight / proxmox-nginx-subdir-proxy.md
Last active April 26, 2024 03:38
proxmox nginx proxy subdirectory

So I have spent my last 4 days to try get proxmox working with an nginx proxy. Due to how proxmox is built up I had to get clever with some rewrite, break some nginx rules and spend sleepless nights awake to try figure this out (to be honest I am no genius on web servers as I rarely have to touch them). Plus it seems like nobody (from my googling) had managed to set proxmox up to work behind a proxied subdir, understandably so as some of the html generated uses absolute paths for sources instead of relative paths and you need to deal with that.

This is the proxmox.conf file i ended up making (Replace all instances of pve.local:8006 with your internal proxmox ip and port) And replace publicwebsite.com with your website domain

NOTE: THIS IS FOR PVE6 and I have no plans to fix for PVE7 as I do not need it behind a reverse proxy anymore.

@julsfelic
julsfelic / protoInherit.js
Created January 26, 2013 11:54
Prototypal Inheritance Pattern (Obj inherit from Obj)
if (typeof Object.create !== 'function') {
Object.create = function(o) {
function F() {};
f.prototype = o;
return new F();
};
}
<script>
function convertArrayOfObjectsToCSV(args) {
var result, ctr, keys, columnDelimiter, lineDelimiter, data;
console.log(args);
data = args || null;
@cruftlord
cruftlord / Subfolder to git repo.md
Last active April 26, 2024 03:37 — forked from korya/Subfolder to git repo.md
Convert subfolder into Git submodule
@liunian
liunian / gist:4116655
Created November 20, 2012 07:57
chrome scrollbar style
/* from http://www.alloyteam.com/wp-content/themes/alloyteam/style.css */
::-webkit-scrollbar-track-piece {
background-color:#f5f5f5;
border-left:1px solid #d2d2d2;
}
::-webkit-scrollbar {
width:13px;
height:13px;
}
::-webkit-scrollbar-thumb {
@liunian
liunian / gist:1885866
Created February 22, 2012 16:24
expand t.co to realLink in twitter page when click
$('#stream-items-id').delegate('.js-tweet-text a[data-expanded-url]', 'click', function(e){
this.href = $(this).attr('data-expanded-url');
});
@jonathantneal
jonathantneal / detect-autofill.js
Created September 11, 2018 14:56
Detect autofill in Chrome, Edge, Firefox, and Safari
export default scope => {
// match the filter on autofilled elements in Firefox
const mozFilterMatch = /^grayscale\(.+\) brightness\((1)?.*\) contrast\(.+\) invert\(.+\) sepia\(.+\) saturate\(.+\)$/
scope.addEventListener('animationstart', onAnimationStart)
scope.addEventListener('input', onInput)
scope.addEventListener('transitionstart', onTransitionStart)
function onAnimationStart(event) {
// detect autofills in Chrome and Safari by:
@liunian
liunian / gist:1875119
Created February 21, 2012 08:25
use curl to get headers if get_headers is unable to use
<?php
/**
* Script to check link validity
*
* @author Satya Prakash
*
*/
$links = array();
$links[] = 'http://www.satya-weblog.com/2007/04/dynamically-populate-select-list-by.html';