Skip to content

Instantly share code, notes, and snippets.

View stephanebruckert's full-sized avatar

Stéphane Bruckert stephanebruckert

View GitHub Profile
@stephanebruckert
stephanebruckert / Triple-Doughtnut-Chart.markdown
Created September 22, 2014 09:41
A Pen by Stéphane Bruckert.
@stephanebruckert
stephanebruckert / README.markdown
Last active August 29, 2015 14:11
Jenkins quarantine email template

Jenkins email template with Quarantine

This template is ment to be used with the Jenkins Quarantine plugin. It hides the quarantined tests from the failing test list.

To use, set ${SCRIPT, template="Groove.template"} as the Default content in your Extended E-mail Notification settings.

function get_html_description($description) {
return
// 1. Handle tags (pages, people, etc.)
preg_replace_callback("/@\[([0-9]*):([0-9]*):(.*?)\]/", function($match) {
return '<a href="http://facebook.com/'.$match[1].'">'.$match[3].'</a>';
},
// 2. Handle hashtags
preg_replace_callback("/#(\w+)/", function($match) {
return '<a href="http://facebook.com/hashtag/'.$match[1].'">'.$match[0].'</a>';
@stephanebruckert
stephanebruckert / Get Post Info from link FQL
Last active August 29, 2015 14:12
Get like, share and comment count from Facebook post link (FQL request) http://stackoverflow.com/q/19061937/1515819
SELECT like_info.like_count, comment_info.comment_count, share_count
FROM stream
WHERE post_id IN (
SELECT concat(id,'_', substr("https://www.facebook.com/Macklemore/posts/10153256675935268", strpos("https://www.facebook.com/Macklemore/posts/10153256675935268", '/posts')+7, strlen("https://www.facebook.com/Macklemore/posts/10153256675935268")))
FROM profile WHERE username IN (
SELECT substr(url, strpos(url, 'facebook.com/')+13, strpos(url, '/posts')-strpos(url, 'facebook.com/')-13)
FROM object_url
WHERE url = "https://www.facebook.com/Macklemore/posts/10153256675935268"))
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Namespace and dependencies
;;
(ns sdk-helpers.log
;; Clojure
(:require [clojure.string :refer [split join]]
[clojure.core.match :refer [match]]
;; 3rd-party
[taoensso.timbre :as timbre]))
(ns unit.sdk-helpers.log-test
(:require [midje.sweet :refer :all]
[taoensso.timbre :as timbre]))
(defn my-output-fn [data]
(clojure.pprint/pprint "my-output-fn was called")
(timbre/default-output-fn data))
(defn init [level]
(timbre/merge-config! {:output-fn my-output-fn})
import Ember from 'ember';
import { buildValidations, validator } from 'ember-cp-validations';
const Validations = buildValidations({
email: {
type: 'email',
validators: [
validator('format'),
validator('uniqueness')
]

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@stephanebruckert
stephanebruckert / reverse-playlist.py
Last active February 17, 2020 03:44
Reverse a Spotify playlist
import os
import spotipy
import spotipy.util as util
'''
python3 script to reverse a Spotify playlist, i.e.:
A B C D E (before)
E D C B A (after)