Skip to content

Instantly share code, notes, and snippets.

View jonasdk's full-sized avatar

Jonas Krat jonasdk

View GitHub Profile
@everttrollip
everttrollip / remove-git-lfs.md
Last active April 3, 2025 02:49
Removing git lfs from (any) repository

So, it has been an interesting journey, but time to remove git-lfs. Here follows a summary of the approach I used to safely remove git-lfs,

  • commit & push everything
  • create a branch, something like fix/remove-lfs
  • remove hooks git lfs uninstall
  • remove lfs stuff from .gitattributes (open file, delete content - don't delete the file!)
  • list all lfs files, git lfs ls-files
  • run git rm --cached for each file
    • if your list is big, copy the contents into a file.txt
  • make sure you remove the number and asterik on each line, you only want the paths to the files
@tgwizard
tgwizard / vcl_deliver.vcl
Last active June 8, 2019 17:31
Fastly VCL config for A/B tests
sub vcl_deliver {
# ----- snip -----
# Set a cookie with the experiment group sequence, if the client didn't
# already have the cookie and provided it in the request, and if the origin
# hasn't already set it. Use `setcookie.get_value_by_name` to handle the
# cases when the backend sets multiple cookies.
# Only do this on the edge nodes, not the origin shield, otherwise the edge
# nodes will see a response with a `Set-Cookie` header and not cache it.
@nbouvrette
nbouvrette / inputTypeNumberPolyfill.js
Last active March 28, 2023 11:26
Stand alone JavaScript polyfill allow only numbers on input of type number.
/**
* Stand alone polyfill allow only numbers on input of type number.
*
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on
* input of type text.
*
* Supports:
*
@marcelometal
marcelometal / thumbor.service
Created July 27, 2015 22:25
Thumbor systemd
# File: /lib/systemd/system/thumbor.service
[Unit]
Description=Photo thumbnail service
[Service]
Type=simple
ExecStart=/usr/bin/thumbor -c /etc/thumbor.conf
[Install]
@addyosmani
addyosmani / README.md
Last active October 2, 2025 12:05 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active March 12, 2025 01:22
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");