Skip to content

Instantly share code, notes, and snippets.

View salahm's full-sized avatar

Salah MEHARGA salahm

View GitHub Profile
@Nicofuma
Nicofuma / fluent-setters.md
Created August 25, 2016 12:28
PHPStrom templates (PHP 5 & 7, type hint arrays, string[] support, ...)
#set($typeHintText = "$TYPE_HINT")
#set($nonTypeHintableTypes = ["", "string", "int", "mixed", "number", "void", "object", "real", "double", "float", "resource", "null", "bool", "boolean"])
#foreach($nonTypeHintableType in $nonTypeHintableTypes)
    #if ($nonTypeHintableType == $TYPE_HINT)
        #set($typeHintText = "")
    #end
#end

#if ($typeHintText.matches('^((\\)?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+)+$'))
<?php
<<<CONFIG
packages:
- "kriswallsmith/buzz: ^0.15.0"
- "symfony/console: ^3.2@dev"
CONFIG;
// Find you token on https://api.slack.com/docs/oauth-test-tokens
use Buzz\Message\Response;

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@nfabre
nfabre / Symfony Live Paris.markdown
Last active October 7, 2020 12:27
Slides Symfony Live 2013
@m4dz
m4dz / README.md
Last active January 27, 2023 01:14
OS X Fresh (Re)Install

OS X ENV (re)Install

This is my personal guide to restore my configuration and setup my system for a fresh install. I use it and keep it updated frequently. Hope it will inspire you on your own way =].

Backup

Before a fresh reinstall, don't forget to backup many things. A regular ghost made with CarbonCopyCloner or Clonezilla is a good solution, but if you can't, you should save the following: