Skip to content

Instantly share code, notes, and snippets.

View jansilvo's full-sized avatar
🎯
Focusing

jansilvo

🎯
Focusing
View GitHub Profile
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active May 1, 2025 14:42
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - [email protected]</title>
</head>
<body>
<outline text="PHP" title="PHP">
<outline htmlUrl="http://frederickvanbrabant.com" title="frederickvanbrabant.com" xmlUrl="http://frederickvanbrabant.com/feed.xml" type="rss" text="frederickvanbrabant.com"/>
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/>
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/>
@titpetric
titpetric / graphql-mini.php
Created April 11, 2017 08:47
Transform GraphQL fields into JSON to use them for filtering native PHP arrays
<?php
/** A poor mans GraphQL fields parser
*
* Try to convert graphQL fields to JSON and then just use json_decode to produce an array.
*/
class Fields
{
/** Parse GraphQL fields into an array */
public static function parse($query)
@Grummfy
Grummfy / exakat-runner.sh
Last active June 12, 2018 16:28
exakat tips
#!/bin/bash
# <name of project> <path to project>
PROJECT_NAME=$1
PROJECT_BASE_PATH=$2
EXAKAT_PROJECT_PATH=$(pwd)
echo 'get last version'
docker pull exakat/exakat
@inetbiz
inetbiz / article.json
Created March 7, 2017 18:32
Schema Article with Comments [ Work in Progress ]
{
"@context": "http://schema.org",
"@type": "Article",
"author": "John Doe",
"interactionStatistic": [
{
"@type": "InteractionCounter",
"interactionService": {
"@type": "Website",
"name": "Twitter",
@waleedahmad
waleedahmad / post_install.sh
Last active February 11, 2025 17:52
Ubuntu post installation script for installing software of your choice.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
else
#Update and Upgrade
echo "Updating and Upgrading"
apt-get update && sudo apt-get upgrade -y
@wojteklu
wojteklu / clean_code.md
Last active May 4, 2025 09:55
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@inetbiz
inetbiz / organization.json
Last active June 20, 2017 23:44
JSON+LD Organization Schema with extensive data
{
"@context": "http://schema.org",
"@type": "Organization",
"@id": "#publisher",
"@reverse":
{
"publisher":
{
"@type":"Website",
"potentialAction":
@QuantumGhost
QuantumGhost / example.puml
Last active September 21, 2024 19:19
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@bahmutov
bahmutov / Docker shell commands.sh
Last active February 9, 2024 07:55
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .