Skip to content

Instantly share code, notes, and snippets.

@poul-kg
poul-kg / valet.conf
Last active October 23, 2023 10:48
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@peterdemartini
peterdemartini / command.sh
Last active March 28, 2024 17:49
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@nielsvr
nielsvr / fulfillment.php
Last active January 12, 2016 07:40
Hook into the fulfillment status of Pronamic IDEAL
<?php
class Fulfillment {
/**
* Constructs and initialize
*/
public function __construct() {
@TWIAV
TWIAV / README.md
Last active May 14, 2022 18:30
D3/TopoJSON: map wit SVG Text labels

My very first exercise with TopoJSON and D3 - just a municipal map showing some basic information when you hover over the individual municipalities. Nothing really fancy, but, hey, you have got to start somewhere...

###Steps followed to create the file nlgemeenten2009.json:

Step 1. download input file gem_2009_gn3.shp from the Dutch Statistical Office: Wijk- en Buurtkaart 2009

Step 2. convert shapefile to GeoJSON with ogr2ogr:

    ogr2ogr \
 -f GeoJSON \
@csswizardry
csswizardry / SassMeister-input.scss
Last active March 27, 2020 15:15
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$spacing-unit: 24px;
$spacing-unit-tiny: round(0.25 * $spacing-unit);
$spacing-unit-small: round(0.5 * $spacing-unit);
$spacing-unit-large: round(2 * $spacing-unit);
@rutger1140
rutger1140 / .htaccess
Created October 8, 2014 15:30
Kirby CMS htaccess file - SEO optimized - 1000+ spam related IP blocks
# pass the default character set
AddDefaultCharset utf-8
php_flag short_open_tag on
ErrorDocument 404 /error
# Kirby .htaccess
# exclude panel from trailing slash removal
@stefthoen
stefthoen / pp.yml
Last active August 29, 2015 14:03
Tmuxinator yml for WordPress website
# ~/.tmuxinator/pp.yml
name: pp
root: ~/Sites/paprikapatterns/web/app/themes/paprikapatterns/
windows:
- theme:
layout: 15b0,204x46,0,0[204x40,0,0,0,204x5,0,41{102x5,0,41,3,50x5,103,41,4,50x5,154,41,6}]
panes:
# TODO:
# - Maximize and restore a pane with Up-arrow and Down-arrow
# - Fix probleem met lijnregels als je kopieert uit Vim
# Set new leader
unbind C-b
set -g prefix C-a
# Set index of window and pane
set -g base-index 1
@raucao
raucao / typekit.js
Last active February 12, 2020 06:25
Improved Typekit embed code
(function(d) {
var tkTimeout=3000;
if(window.sessionStorage){if(sessionStorage.getItem('useTypekit')==='false'){tkTimeout=0;}}
var config = {
kitId: 'a1b2c3f4',
scriptTimeout: tkTimeout
},
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";if(window.sessionStorage){sessionStorage.setItem("useTypekit","false")}},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='//use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
})(document);
@denji
denji / nginx-tuning.md
Last active April 11, 2024 06:45
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.