Skip to content

Instantly share code, notes, and snippets.

View Profpatsch's full-sized avatar
🌮

Profpatsch

🌮
View GitHub Profile
@qntm
qntm / multiline.js
Last active October 16, 2023 12:39
// TODO: longer method name
Function.prototype.extractBlockCommentAsMultilineString = function() {
return this.toString().match(/^function \(\)\{\s*\/\*((?:[^*]|\*+[^*\/])*)\*+\/\s*\}$/)[1];
};
var s = function(){/*
STRING
GOES
HERE
*/}.extractBlockCommentAsMultilineString();
@pcdavid
pcdavid / setup-external-screen
Last active September 27, 2018 13:47
Enabling 2560x1440 under Linux (tested with Ubuntu 13.10 on an Asus Zen Prime UX31A with Intel HD 4000 and a Iiyama XB2779QS)

Try 55 Hz if possible:

% xrandr --newmode "2560x1440_55.00" 220.812 2560 2608 2640 2720 1440 1443 1448 1478 -hsync -vsync
% xrandr --addmode HDMI1 "2560x1440_55.00"

or 30 Hz otherwise:

% xrandr --newmode "2560x1440_30.00" 146.25 2560 2680 2944 3328 1440 1443 1448 1468 -hsync +vsync
% xrandr --addmode HDMI1 "2560x1440_30.00"
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@zyxar
zyxar / exercise.tour.go
Last active April 15, 2024 07:08
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)