Skip to content

Instantly share code, notes, and snippets.

View bmichotte's full-sized avatar

Benjamin Michotte bmichotte

View GitHub Profile
@bmichotte
bmichotte / web-servers.md
Created March 3, 2022 09:45 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bmichotte
bmichotte / spotify-now-playing.js
Created September 30, 2020 11:20 — forked from marco79cgn/spotify-now-playing.js
A Scriptable iOS widget that shows what‘s playing on Spotify
let spotifyCredentials
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
async function createWidget() {
let widget = new ListWidget()
let spotifyIcon = await getImage("spotify-icon.png")
widget.backgroundColor = new Color("1e2040")
@bmichotte
bmichotte / spotify-now-playing.js
Created September 30, 2020 11:20 — forked from marco79cgn/spotify-now-playing.js
A Scriptable iOS widget that shows what‘s playing on Spotify
let spotifyCredentials
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
async function createWidget() {
let widget = new ListWidget()
let spotifyIcon = await getImage("spotify-icon.png")
widget.backgroundColor = new Color("1e2040")
@bmichotte
bmichotte / some.php
Created May 14, 2020 11:15
attributes
<?php
class Foo
{
function bar(int $value): void
{
if ($value < 0) {
throw new Exception('....');
}
@bmichotte
bmichotte / .php_cs.laravel.php
Created July 17, 2019 15:19 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
struct A { let a: String }
let array = [A(a: "b"), A(a: "C"), A(a: "b")]
let dictionary = Dictionary(grouping: array) { $0.a }
dictionary
extension Array {
func group<K: Hashable, Element>(_ fn: (Element) -> K) -> Dictionary<K, [Element]> {
return Dictionary<K, [Element]>(grouping: self, by: fn)
}
}
@bmichotte
bmichotte / !NOTE.md
Created August 24, 2017 14:55 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
Thread 0 Crashed:
0 HSTracker 0x00000001054173a9 function signature specialization <Arg[0] = Owned To Guaranteed, Arg[1] = Dead and Owned To Guaranteed> of HSTracker.DeckManager.tableView (__ObjC.NSTableView, viewForTableColumn : __ObjC.NSTableColumn?, row : Swift.Int)__ObjC.NSView? (DeckManager.swift:0)
1 HSTracker 0x00000001054120ad @objc HSTracker.DeckManager.tableView (__ObjC.NSTableView, viewForTableColumn : __ObjC.NSTableColumn?, row : Swift.Int)__ObjC.NSView? (DeckManager.swift:0)
2 AppKit 0x00007fff8a2a28e0 -[NSTableView(NSTableViewViewBased) makeViewForTableColumn:row:] + 75
3 AppKit 0x00007fff8a2a1c44 -[NSTableRowData _addViewToRowView:atColumn:row:] + 299
4 AppKit 0x00007fff8a2a198d -[NSTableRowData _addViewsToRowView:atRow:] + 183
5 AppKit 0x00007fff8aa02d8b -[NSTableRowData _initializeRowView:atRow:] + 372
6 App
@bmichotte
bmichotte / # mysql - 2016-04-06_10-22-29.txt
Last active April 8, 2016 15:23
mysql on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for mysql on Mac OS X 10.11.4
Build date: 2016-04-06 10:22:29
class MyXLFormScreen < PM::XLFormScreen
def form_data
[
{
cells: [
{
title: 'my textview',
name: :my_textview,
type: :textview,
cell_class: 'MyXLFormTextViewCell'