Skip to content

Instantly share code, notes, and snippets.

View yrezgui's full-sized avatar

Yacine Rezgui yrezgui

View GitHub Profile
@phhusson
phhusson / gist:662af3573ad4fc91bb62e5fe7cde7250
Created March 14, 2022 13:12
Add rickroll Dialer option. Add rick.webm in assets
From f07ca2a26dcb0cc797dcc6fc0d2d4f16b89c481e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 14 Mar 2022 09:09:28 -0400
Subject: [PATCH] Add a rickroll button in heads-up notification to rickroll
caller
Change-Id: Ibe72535fb3e93f69a531723dc96ede05663ee251
---
assets/rick.webm | Bin 0 -> 1232413 bytes
.../NotificationBroadcastReceiver.java | 145 ++++++++++++++++++
@ianhanniballake
ianhanniballake / PickImageContracts.kt
Last active September 10, 2022 18:03
Gist showing how to write backward compatible ActivityResultContracts for supporting Android 13's new Photo Picker: https://developer.android.com/about/versions/13/features/photopicker
/**
* Use this [ActivityResultContract] to seamlessly switch between
* the new [MediaStore.ACTION_PICK_IMAGES] and [Intent.ACTION_GET_CONTENT]
* based on the availability of the Photo Picker.
*
* Use [PickMultipleImages] if you'd like the user to be able to select multiple
* photos/videos.
*
* Input: the mimeType you'd like to receive. This should generally be
* either `image/\*` or `video/\*` for requesting only images or only videos
@florina-muntenescu
florina-muntenescu / build.gradle.kts
Created July 2, 2021 15:29
Proto DataStore config in Gradle Kotlin DSL
/* Copyright 2021 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
import com.google.protobuf.gradle.*
plugins {
// find latest version number here:
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-gradle-plugin
id("com.google.protobuf") version "0.8.16"
...
@fasterthanlime
fasterthanlime / cities.json
Created July 5, 2020 17:53 — forked from Miserlou/cities.json
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@HashNuke
HashNuke / SwiftUI-SplitView-MacOS.swift
Last active January 5, 2024 18:53
Using a NSSplitViewController with SwiftUI on mac to render SwiftUI views as split panes. Drop this code into a playground to try it out. SORRY MAC-OS ONLY. DOES NOT WORK ON IOS
import AppKit
import SwiftUI
// Delete this line if not using a playground
import PlaygroundSupport
struct ContentView: View {
var body: some View {
// if spacing is not set to zero, there will be a gap after the first row
@aendra-rininsland
aendra-rininsland / gdpr-sar-template.txt
Created January 3, 2020 16:46
GDPR Subject Access Request -- Template
Hi there! Please forward this to your GDPR compliance department. Thank you!
--
To whom it may concern — I'm interested in what sorts of data your company collects about me.
To wit, I would like to file a Subject Access Request (SAR) under the EU General Data Protection Regulation (GDPR) for all personal information relating to myself using the following personal identifiers:
[ list which PII you feel or can prove is held by the entity in question ]
@sebmarkbage
sebmarkbage / WhyReact.md
Created September 4, 2019 20:33
Why is React doing this?

I heard some points of criticism to how React deals with reactivity and it's focus on "purity". It's interesting because there are really two approaches evolving. There's a mutable + change tracking approach and there's an immutability + referential equality testing approach. It's difficult to mix and match them when you build new features on top. So that's why React has been pushing a bit harder on immutability lately to be able to build on top of it. Both have various tradeoffs but others are doing good research in other areas, so we've decided to focus on this direction and see where it leads us.

I did want to address a few points that I didn't see get enough consideration around the tradeoffs. So here's a small brain dump.

"Compiled output results in smaller apps" - E.g. Svelte apps start smaller but the compiler output is 3-4x larger per component than the equivalent VDOM approach. This is mostly due to the code that is usually shared in the VDOM "VM" needs to be inlined into each component. The tr

@unnamedd
unnamedd / MacEditorTextView.swift
Last active April 16, 2024 10:18
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
@s1s1ty
s1s1ty / post-mysql.go
Created July 31, 2018 07:25
post-mysql
package post
import (
"context"
"database/sql"
models "github.com/s1s1ty/go-mysql-crud/models"
pRepo "github.com/s1s1ty/go-mysql-crud/repository"
)
@busypeoples
busypeoples / Heap.re
Last active July 29, 2018 10:43
Data Structures in ReasonML: #7 Heap
/* Heap */
exception Not_Found;
module type Ord = {type t; let compare: (t, t) => int;};
module Integer = {
type t = int;
let compare = (a, b) => a - b;
};