Skip to content

Instantly share code, notes, and snippets.

View stephanebruckert's full-sized avatar

Stéphane Bruckert stephanebruckert

View GitHub Profile
@stephanebruckert
stephanebruckert / git-force-tag-minor-major.sh
Last active March 19, 2021 15:07
Automatically force-tag v1 and v1.0 when creating v1.0.0 (as done in the docker registry)
#!/bin/bash
echo "Make sure:
- you understand the content of this script before running it.
It can be dangerous as it aims to simplify overriding major and minor versions for the latest tag.
- you are currently on the commit you want to tag, so don't forget to pull.
"
read -p "SemVer version: " version
for run in {1..3}; # once for each of patch, minor and major
@stephanebruckert
stephanebruckert / 2trancentral_youtube_channel_backup.csv
Last active August 25, 2024 09:20
1105 track titles from 2trancentral youtube channel before it gets hacked and deleted. This data is fully synced with this Spotify playlist https://open.spotify.com/playlist/7GlxpQjjxRjmbb3RP2rDqI Provided by www.mirror.fm
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 7 columns, instead of 3 in line 7.
yt_channel_id (S),yt_published_at (S),yt_track_id (S),yt_track_name (S),spotify_found_time (S),spotify_playlist (S),spotify_uri (S)
UCL4J20Y1UpQGttcNXMB2j9Q,2010-03-28T20:31:37.000Z,VVVMNEoyMFkxVXBRR3R0Y05YTUIyajlRLlNjMDJyS0pYeDlB,CK/NY - Fortys On Ice (Majestic Mix),,,
UCL4J20Y1UpQGttcNXMB2j9Q,2010-03-29T00:08:35.000Z,VVVMNEoyMFkxVXBRR3R0Y05YTUIyajlRLnM2NEh3eWhIbFc0,Aurasfere - Terrasuave (1994),,,
UCL4J20Y1UpQGttcNXMB2j9Q,2010-03-29T09:49:14.000Z,VVVMNEoyMFkxVXBRR3R0Y05YTUIyajlRLkFsVmx0QkpHZy1j,Remy & Sven - Silent Eruption (1992),,,
UCL4J20Y1UpQGttcNXMB2j9Q,2010-03-29T21:39:06.000Z,VVVMNEoyMFkxVXBRR3R0Y05YTUIyajlRLmRwV0REbmRWOUZJ,Alien Signal - Quantum Limit (1993),,,
UCL4J20Y1UpQGttcNXMB2j9Q,2010-03-30T19:28:57.000Z,VVVMNEoyMFkxVXBRR3R0Y05YTUIyajlRLlhob1h0QXRYc0tJ,Alien Signal - First Approach (1993),,,
UCL4J20Y1UpQGttcNXMB2j9Q,2010-03-30T20:05:40.000Z,VVVMNEoyMFkxVXBRR3R0Y05YTUIyajlRLjB5Q1RBT0o2Umo4,Alien Signal - The Water Hole (1993),,,
UCL4J20Y1UpQGttcNXMB2j9Q,2010-03-31T15:57:43.000Z,VVVMNEoyMFkxVXBR
@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)

Keybase proof

I hereby claim:

To claim this, I am signing this object:

import Ember from 'ember';
import { buildValidations, validator } from 'ember-cp-validations';
const Validations = buildValidations({
email: {
type: 'email',
validators: [
validator('format'),
validator('uniqueness')
]
(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})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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]))
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;
@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"))
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>';