Skip to content

Instantly share code, notes, and snippets.

View lutangar's full-sized avatar

Johan Dufour lutangar

View GitHub Profile
<?php
// see https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata
namespace PHPSTORM_META {
override(\Doctrine\ORM\EntityManager::find(0), map([
'' => '@',
]));
override(\Interop\Container\ContainerInterface::get(0), map([
'' => '@',
@wiledal
wiledal / template-literals-3-for-loops.js
Last active March 13, 2023 22:47
Template Literals example: For loops
/*
Template literals for-loop example
Using `Array(5).join(0).split(0)`, we create an empty array
with 5 items which we can iterate through using `.map()`
*/
var element = document.createElement('div')
element.innerHTML = `
<h1>This element is looping</h1>
${Array(5).join(0).split(0).map((item, i) => `
@asfaltboy
asfaltboy / TrelloAPI.json
Last active October 2, 2018 19:48
[WIP]: generated swagger of trello api docs
{
"info": {
"termsOfService": "https://trello.com/legal",
"description": "This document describes the REST API of Trello as published by Trello.com. <a href='https://trello.com/docs/index.html' target='_blank'>Official Documentation</a>",
"license": {
"url": "https://trello.com/legal",
"name": "Trello : Terms of Service"
},
"title": "Trello API",
"contact": {
@gaearon
gaearon / Marble.js
Last active February 14, 2019 06:54
Marble-style sequencer + sampler for https://github.com/FormidableLabs/react-music
/*
This replaces <Sequencer> + multiple <Sampler>s with a marble diagram sequencer.
You can use it like this:
<Marble
resolution={16}
samples={[
'samples/kick.wav',
'samples/snare.wav',
]}
@ju2wheels
ju2wheels / Dockerfile
Last active March 9, 2024 13:37
Docker Dockerfile reference template
# Last updated: 08/24/2916
#
# Total instructions available: 18
#
# https://docs.docker.com/engine/reference/builder/
#
# You can use a .dockerignore file in the same context directory as
# your Dockerfile to ignore files in the context before sending them
# to the Docker daemon for building to speed up building.
@lwiesel
lwiesel / instructions.md
Created March 24, 2015 15:21
Set-up a proxmox behind one single IP

Sur la machine hôte, ouvrez /etc/network/interfaces

Déclarez une nouvelle interface en ajoutant les lignes suivantes :

auto vmbr2
iface vmbr2 inet static
	address 10.0.0.1
	netmask 255.255.255.0
	network 10.0.0.0
	broadcast 10.0.0.255
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@JonnieCache
JonnieCache / spacewar.lst
Created December 11, 2012 12:11
Spacewar PDP1 Source Code
-/macro fio-dec system, june 1963
007652 640500 szm=sza sma-szf
007652 650500 spq=szm i
007652 761200 clc=cma+cla-opr
- define senseswitch A
- repeat 3, A=A+A
- szs A
- term
- define init A,B
- law B
@viktorkelemen
viktorkelemen / Custom canvas google maps marker
Created December 9, 2011 15:21
Creating a custom google maps marker with canvas
<!DOCTYPE html>
<html>
<head>
<style>
html {
width: 100%;
height: 100%;
}
body {
@hallettj
hallettj / global-variables-are-bad.js
Created February 14, 2009 21:15
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {