Skip to content

Instantly share code, notes, and snippets.

View jucrouzet's full-sized avatar
🐔
Poulet

Julien CROUZET jucrouzet

🐔
Poulet
View GitHub Profile
package main
import "fmt"
func main() {
fmt.Printf("%v\n", WithoutCap())
fmt.Printf("%v\n", WithCap())
}
func WithoutCap() []int {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test crash</title>
</head>
<body>
Let's crash !
<script type="text/javascript">
@jucrouzet
jucrouzet / extract.go
Last active September 2, 2024 11:22
Extract an Icecast stream title (current song) with go (golang)
import (
"bufio"
"bytes"
"fmt"
"net/http"
"strconv"
)
// GetStreamTitle get the current song/show in an Icecast stream
func (r *Radio) GetStreamTitle(streamUrl string) (string, error) {
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<VAST version="2.0">
<Ad>
<Wrapper>
<VASTAdTagURI>https://vast.mathtag.com/?exch=sta&amp;id=5aW95q2jLzEyLyAvT1dFM09EYzBPREV0TWpneU5DMHpZbUUwTFRBd01EQXRNREF3TURBd01EQXdNREF3LzkwNTI0OTA2Mzc3NzgzMjU0MzQvMzQ1ODgxNC8xOTM3Mjg1LzQ0L01FYX\
k2bzA2RG0xcmZhT2EwdEpjZHZKYjFMSnhDZzdYVGQtOE83WGpGWmsvMi8xNDk0ODIvMTQ4NTQ1MDQ1Ni8xLzM0MjAxNS8zMTA1MjU2OTQzLzE3MjI0NC8zMjc4MzgvMi8wLzAvTURBd01EQXdNREF0TURBd01DMHdNREF3TFRBd01EQXRNREF3TURBd01EQXdNREF3LzAvMC8x\
NDk0ODIvMC8/RYzA0_Os3ItrRJ9yT0rblt3VwWU&amp;sid=1937285&amp;cid=3458814&amp;nodeid=502&amp;auctionid=9052490637778325434&amp;bp=bf_aaaaaa&amp;protocol_version=1&amp;buyerCreativeId=3458814&amp;cvid=1&amp;ai\
d=9052490637778325434&amp;adverid=172244&amp;site=rgtf1-25-49-iptv-tf1pub.com&amp;cacheBuster=1485884090&amp;skippable=0&amp;cmp=327838&amp;dealid=149482&amp;sup_dealid=GRO-AFF-00022&amp;uuid=9a787481-2824-\
3ba4-0000-000000000000&amp;siteid=640985&amp;pid=10736&amp;ip=185.22.117.239&amp;prot=ht
/**
* Serialize a value to BSON.
*
* \param document Document to increment.
* \param index Value index.
*
* \return Serialized value.
*/
bsonSerializedValue _serializedValue(bsonDocument* document, uint index) {
bsonSerializedValue value;
'use strict';
function add(x, y) {
// Addition is one of the four elementary,
// mathematical operation of arithmetic, with the other being subtractions,
// multiplications and divisions. The addition of two whole numbers is the total
// amount of those quantitiy combined. For example in the picture on the right,
// there is a combination of three apples and two apples together making a total
// of 5 apples. This observation is equivalent to the mathematical expression
// "3 + 2 = 5"
'use strict';
function add(x, y) {
// Addition is one of the four elementary,
// mathematical operation of arithmetic with the other being subtraction,
// multiplication and division. The addition of two whole numbers is the total
// amount of those quantitiy combined. For example in the picture on the right,
// there is a combination of three apples and two apples together making a total
// of 5 apples. This observation is equivalent to the mathematical expression
// "3 + 2 = 5"
@jucrouzet
jucrouzet / !es6-42-demos
Last active August 29, 2015 14:21
Examples used during the ES6/7 presentation at 42
=Examples used during the ES6/7 presentation at 42=
@jucrouzet
jucrouzet / keybase.md
Created April 2, 2015 09:12
keybase.md

Keybase proof

I hereby claim:

  • I am jucrouzet on github.
  • I am c2c (https://keybase.io/c2c) on keybase.
  • I have a public key whose fingerprint is E8E6 9D62 C79E B025 5517 3F11 4C4C F0FF DED4 161E

To claim this, I am signing this object:

@jucrouzet
jucrouzet / When 'mal formé' or 'Not well formed' on Firefox Ajax calls
Created February 5, 2015 20:19
This messages comes from the fact that the JSON/XML document is not served with the correct header.jQuery uses XmlHttpRequest inside, so just overrideMimeType #javascript #firefox #jquery #xhr
beforeSend: function(xhr) {
xhr.overrideMimeType('application/json');
},