Skip to content

Instantly share code, notes, and snippets.

View Gasjki's full-sized avatar

George-Cristian Tudoran Gasjki

View GitHub Profile
@ambroisemaupate
ambroisemaupate / security.conf
Last active March 10, 2025 08:21
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
@inf123
inf123 / barchart.php
Created June 20, 2015 23:16
Bar chart in PHP using the GD library
<?php
/*
* Chart data
*/
$data = [
'Jan' => 103,
'Feb' => 24,
'Mar' => 44,
@vasanthk
vasanthk / System Design.md
Last active April 21, 2025 02:58
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@kunicmarko20
kunicmarko20 / Article.php
Last active October 10, 2024 16:34
Symfony Second Level Cache
<?php
namespace AppBundle\Entity;
/**
* @package AppBundle\Entity
* @ORM\Entity()
* @ORM\Table()
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
*/
@jinnabaalu
jinnabaalu / elasticsearch-6.6.0-cors-and-xpack-disabled-activated.yaml
Created February 26, 2019 02:03
Elasticsearch docker-compose file with CORS activated and XPack disabled
version: '3.3'
services:
elasticsearch1:
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.0
environment:
ES_JAVA_OPTS: '-Xms256m -Xmx256m'
cluster.name: es-cluster
node.name: es1
network.bind_host: 0.0.0.0
discovery.zen.minimum_master_nodes: 1