Skip to content

Instantly share code, notes, and snippets.

View philippelatulippe's full-sized avatar

Philippe Latulippe philippelatulippe

View GitHub Profile
@philippelatulippe
philippelatulippe / ublock.txt
Created August 20, 2023 19:27
My uBlock filters
! These filters should be stable even when classes and ids are obfuscated and changing
! youtube.com
! Hides junk in search results. Uses string matching, if you use a different language, just update the /text in slashes/ below
youtube.com##ytd-shelf-renderer:has-text(/Previously watched/)
youtube.com##ytd-shelf-renderer:has-text(/People also watched/)
youtube.com###contents > ytd-shelf-renderer:has-text(/For you/)
youtube.com##ytd-shelf-renderer.style-scope:has(span:has-text(/Watch again/i))
youtube.com##ytd-horizontal-card-list-renderer.ytd-item-section-renderer.style-scope:has(span:has-text(/Searches related to/i))
youtube.com##ytd-shelf-renderer.style-scope:has(span:has-text(/Learn while you\'re at home/i))
@philippelatulippe
philippelatulippe / playground.swift
Created September 2, 2020 14:25
[Swift] Decode a dictionary keyed with an enum
import Foundation
enum MyKey: String, Decodable, CodingKey {
case one
case two
}
struct Response: Decodable {
let dictionary: [MyKey: String]
}

You make some changes, then the ECS Service tells you

The closest matching container-instance ... is missing an attribute required by your task.

Are you running the ECS agent on your own AMI? Maybe you need to update its config to enable some features that are enabled on the amazon AMI but not on by default in the agent.

In our case, we added an IAM role to the task, but this functionality isn't enabled by default. As a result, ECS would refuse to deploy on any of the instances on our cluster. We had to update our AMI with a new config.

@philippelatulippe
philippelatulippe / swagger-codegen-swift3.md
Created November 17, 2016 10:06
How to generate Swift 3 client library with swagger-codegen

How to generate Swift 3 code with swagger-codegen

  1. Clone the swagger-codegen repo, checkout the branch "2.3.0"

  2. mvn clean package

  3. Create a shell script to make it easier to run your version of swagger-codegen:

/usr/local/bin/swagger-codegen-2.3.0

@philippelatulippe
philippelatulippe / terraform-ecs-asg-error.md
Created September 22, 2016 10:45
Terraform AWS: Unsupported service namespace, resource type or scalable dimension

If you try to attach an auto-scaling group to an ECS service and you get

Unsupported service namespace, resource type or scalable dimension

Then it's possible you didn't correctly format the resource_id in your aws_appautoscaling_target. It needs to be in the format service/clusterName/serviceName, and terraform will not format it for you. Try:

resource_id = "service/${aws_ecs_cluster.MY_CLUSTER.name}/${aws_ecs_service.MY_SERVICE.name}"
@philippelatulippe
philippelatulippe / ios_range_sliders.md
Last active May 3, 2016 14:54
Range sliders for iOS

It should look like UISlider and have two thumbs.

  • NMRangeSlider Looks good, many users, but the creator is gone and there's tons of personal forks. Doesn't work with Swift!
  • TTRangeSlider Maintained, but doesn't look like UISlider. (It has neither thumbs nor a different bar colour for the selected range) It doesn't track touch very well, when touch leaves the control then returns inside of it, the thumb move independently from the finger.
  • MSRangeSlider Many downloads from cocoapods, but no forks, issue or stars on github. It doesn't track touch very well, the thumb doesn't move right away, and it has the same issue as TTRangeSlider.
  • MARKRangeSlider
@philippelatulippe
philippelatulippe / openpgp4fpr_test.md
Last active August 29, 2015 14:25
OpenKeychain URL test
  • I don't have this key, full fingerprint, uppercase openpgp4fpr:C1D34B69219E4AEEC0BA1C21E3FDFF218E45B72B
  • I don't have this key, full fingerprint, lowercase openpgp4fpr:c1d34b69219e4aeec0ba1c21e3fdff218e45b72b
  • I don't have this key, 64-bit fingerprint, uppercase openpgp4fpr:1C21E3FDFF218E45B72B
  • I don't have this key, 64-bit fingerprint, lowercase openpgp4fpr:1c21e3fdff218e45b72b
  • my key, 64-bit, uppercase
  • my key, full fingerprint, lowercase

what a waste, github blocks unknown URIs.

huh

@philippelatulippe
philippelatulippe / android-multi-boot.md
Last active March 17, 2024 02:32
Android dual-boot / multi-boot

I'm experimenting with sharing my notes for dead-end projects like these. Maybe they'll be useful for someone who stumbles on them.

I have a Nexus 4, I'm hoping to run CM and Firefox OS. I want CM auto-updates to work, I'd rather not build my own kernel. It needs to be completely open source, with no dubious binaries to download.

  • Ubuntu Phone has a tool for dual-booting with android. The details make it sound quite simple.
  • The state of the art seems to be MultiRom which uses kexec.

MultiRom

Interrupts boot process with an OS picker, then uses kexec to run the other OS.

Keybase proof

I hereby claim:

  • I am philippelatulippe on github.
  • I am philippe00 (https://keybase.io/philippe00) on keybase.
  • I have a public key whose fingerprint is 8FEC 7205 7D55 62F0 A40D 2D35 12E9 B401 4345 998C

To claim this, I am signing this object: