Skip to content

Instantly share code, notes, and snippets.

Mois du JS

~ 10 minutes / question

Introduction

  • Quel framework allez vous plus particulièrement défendre ?
  • Pourquoi vous défendez ce framework, et quel est votre experience avec celui ci.
  • Pour finir, dites moi votre experience avec les autres frameworks.
should = require('chai').should()
class MineSweeper
constructor: (gridAsString) ->
return if !gridAsString?
grid = gridAsString.split '\n'
firstLine = grid[0].split ' '
@width = +firstLine[0]
@height = +firstLine[1]
@grid = grid[1..]
@jeanlaurent
jeanlaurent / whoisthere.sh
Last active December 16, 2015 18:29
who is there ?
#!/bin/sh
ip=`ifconfig | awk '/inet /' | awk '!/127.0./' | awk '!/172./' | awk '{ print $2 }'`
subnet=`echo $ip | cut -d '.' -f1-3`
sudo arp-scan -l | grep "$subnet" | awk '{print $2}' | tr '[:lower:]' '[:upper:]'
# sudo nmap -sP $subnet.1-254 | grep MAC | awk '{print $3}'
@jeanlaurent
jeanlaurent / gist:5474503
Created April 27, 2013 20:08
Jekyll with complex data in the YAML front matter parsed by liquid template
---
products:
- {prix: 17, name: mon-cahier-3, description: "<a href='mailto:someone@morlhon.net?subject=test%20test'>jl</a>"}
- {prix: 18, name: mon-cahier-7, description: "<h1>TEST</h1>"}
---
<html>
<head>
<title>Jekyll test</title>
</head>
<body>
pms = ->[
'rasperrypi',
'windows embedded',
'46"',
'hubot',
'node.js',
'arp-scan',
'airplay',
'studio',
'visuwall',
@jeanlaurent
jeanlaurent / literate.litcoffee
Created February 28, 2013 13:12
A first example of literate coffeescript

#Literate CoffeeScript

This is a first example of writing a markdown file with literate coffeescript

Literate coffeescript, let you mix Markdown syntax with plain coffeescript.

class Person
	constructor: (@name) ->
		@age = 0
@jeanlaurent
jeanlaurent / codestory_json_to_md.coffee
Created February 1, 2013 20:00
Read codestory data in json to markdown for a blog post
fs = require 'fs'
json = fs.readFileSync 'data.json.1','UTF-8'
data = JSON.parse json
data.sort (a,b) ->
b.perf - a.perf
for user in data when user.perf >= 1000
console.log "* ![](#{user.gravatar})#{user.name} #{user.perf}"
@jeanlaurent
jeanlaurent / gist:e65e70a89da3ead4c595
Created December 2, 2015 15:55
VBoxManage.exe list hostonlyifs
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe list hostonlyifs
Name: VirtualBox Host-Only Ethernet Adapter
GUID: cd53cf39-13e8-40d0-b24d-55b04cf31c82
DHCP: Disabled
IPAddress: 192.168.56.1
NetworkMask: 255.255.255.0
IPV6Address: fe80:0000:0000:0000:2182:a89c:b9de:eabd
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType: Ethernet
FULL_BASH_VERSION=`bash --version | head -1 | cut -d' ' -f4 | cut -d'.' -f1-3`
BASH_VERSION=`bash --version | head -1 | cut -d' ' -f4 | cut -d'.' -f1`
echo "Current bash version is $FULL_BASH_VERSION"
if [[ $BASH_VERSION -ge 4 ]]; then
echo "Your BASH version is ok"
else
echo "Your BASH version is too low"
fi
@jeanlaurent
jeanlaurent / check_docker_dns.sh
Created November 19, 2015 17:55
This check the current dns setting on mac against the current dns settings in the docker machine default
diff <(scutil --dns | grep 'nameserver\[[0-9]*\]' | cut -d' ' -f5 | sort | uniq) <(docker-machine ssh default cat /etc/resolv.conf | cut -d' ' -f2)