Skip to content

Instantly share code, notes, and snippets.

View clawfire's full-sized avatar
🐻
Being cool

Thibault Milan clawfire

🐻
Being cool
View GitHub Profile
@wildestpixel
wildestpixel / code.py
Last active July 17, 2022 23:43
Raspberry Pi Pico & Pimoroni RGB Keypad HID in Circuitpython 6.2+
# Adapted from Sandy J Macdonald's gist at https://gist.github.com/sandyjmacdonald/b465377dc11a8c83a8c40d1c9b990a90 to configure all buttons and switch off all lights in loop
import time
import board
import busio
import usb_hid
from adafruit_bus_device.i2c_device import I2CDevice
import adafruit_dotstar
@sandyjmacdonald
sandyjmacdonald / code.py
Created January 23, 2021 11:23
Emergency cat GIF macro example for Pimoroni RGB Keypad for Raspberry Pi Pico
import time
import board
import busio
import usb_hid
from adafruit_bus_device.i2c_device import I2CDevice
import adafruit_dotstar
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
<?php
/**
* The plugin bootstrap file
*
* @wordpress-plugin
* Plugin Name: AcfRepeater
* Description: Add acf-repeater dynamic tag
* Version: 1.0.0
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@martymcguire
martymcguire / _includes_facepile.html
Created June 20, 2017 18:39
Plugin and templates to make Webmention.io data available to a Jekyll site
{% unless include.faces == empty %}
<div class="row" style="margin-bottom: 1em"><div class="col-xs-12">
<h4>{{ include.name }}</h4>
<div class="facepile">
{% for face in include.faces %}
{% assign author = face.data.author %}
{% if author.photo %}
{% assign photo = author.photo | imageproxy: 60 %}
{% endif %}
{% case include.mftype %}
@Tibb
Tibb / Localized String
Created February 7, 2017 14:47
Swift extension to ease NSLocalizedString
extension String {
var localized : String {
return NSLocalizedString(self, comment: "")
}
}
//Usage: label.text = "myString".localized
@Phlow
Phlow / pagination-collection.liquid
Last active October 13, 2023 03:10
If you need pagination for a collection in a Jekyll theme, you can use the following Liquid logic which works also on Github pages
{% comment %}
#
# I modified the original code from http://anjesh.github.io/2015/01/25/collection-pagination-working-github-pages/
#
# Make a collection in _config.yml and create the folder _your_collection in your root.
#
# collections:
# your_collection:
# output: true
# permalink: /:collection/:title/
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@ronan-gloo
ronan-gloo / i-extend-charlie.php
Last active January 4, 2016 14:01
I extend Charlie
<?php
class Charlie
{
/**
* @deprecated
*/
final public function __destruct()
{
throw new NonRealisticCallException('Sorry, we are unable to complete your request');
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@jlong
jlong / SassMeister-input.scss
Created February 1, 2014 22:53
Navigate a nested maps with map-fetch() in Sass
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
//
// map-fetch($map, $keys)
//
// An easy way to fetch a deep value in a multi-level map. Works much like
// map-get() except that you pass multiple keys as the second parameter to