Skip to content

Instantly share code, notes, and snippets.

View tlvenn's full-sized avatar

Christian Meunier tlvenn

View GitHub Profile
@satya164
satya164 / patch.diff
Last active November 8, 2023 16:36
Android Gradle Plugin 8 support for React Native libraries
diff --git a/android/build.gradle b/android/build.gradle
index 525cb31..6af104d 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -36,7 +36,30 @@ def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["MyLib_" + name]).toInteger()
}
+def supportsNamespace() {
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
@lukepighetti
lukepighetti / ultrawide-simple.js
Created February 17, 2023 02:23
My Amethyst Ultrawide Layout
const centerColumnWidthFactor = 0.4;
// Prioritizes center with adjustable width factor
// Fills column left, then right
// Then splits right column vertically
// Then splits left column vertically
function layout() {
return {
name: "Ultrawide Simple",
getFrameAssignments: (windows, screenFrame) => {
@lukepighetti
lukepighetti / .zshrc
Last active April 9, 2024 11:59
zsh functions I use for Helix / Flutter development
function flutter-watch(){
local PID_FILE="/tmp/tf$$.pid"
tmux new-session \;\
send-keys "flutter run --pid-file=$PID_FILE" Enter \;\
split-window -v \;\
send-keys "npx -y nodemon -e dart -x \"cat $PID_FILE | xargs kill -s USR1\"" Enter \;\
resize-pane -y 5 -t 1 \;\
select-pane -t 0 \;
rm $PID_FILE;
}
@gaetschwartz
gaetschwartz / settings.json
Last active March 7, 2024 15:09
Nest files in Flutter projects on VSCode, inspired from https://github.com/antfu/vscode-file-nesting-config
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"pubspec.yaml": ".flutter-plugins, .packages, .dart_tool, .flutter-plugins-dependencies, .metadata, .packages, pubspec.lock, build.yaml, analysis_options.yaml, all_lint_rules.yaml",
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
"readme.*": "authors, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md",
"*.dart": "$(capture).g.dart, $(capture).freezed.dart",
},
@flaviut
flaviut / Setting up Emporia Vue 2 with ESPHome.md
Last active March 12, 2024 00:27
Setting up Emporia Vue 2 with ESPHome
@roipeker
roipeker / main.dart
Created June 4, 2021 19:54
GraphX issue #19: simpler gesture transform (zoom, drag, rotate)
/// live demo: https://graphx-gesture-simple.surge.sh
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
import 'package:graphx_zoompan/simple_zoom.dart';
void main() {
runApp(AppSimpleZoom());
}
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart' as urlLauncher;
void main() => runApp(App());
class App extends StatelessWidget {
static const title = 'Flutter App';
@override
Widget build(BuildContext context) => MaterialApp(
@dhh
dhh / tracker_blocking.rb
Last active July 27, 2023 14:19
Current list of spy pixels named'n'shamed in HEY, as of April 23, 2020
module Entry::TrackerBlocking
extend ActiveSupport::Concern
included do
has_many :blocked_trackers
end
email_service_blockers = {
"ActiveCampaign" => /lt\.php(.*)?l\=open/,
"AWeber" => "openrate.aweber.com",
@romansorin
romansorin / .storybook
Created November 10, 2019 00:52
Gatsby, TailwindCSS, Storybook configuration
- addons.js
- config.js
- webpack.config.js
@sibelius
sibelius / useSubmit.tsx
Created October 31, 2019 19:17
useSubmit hook to make sure you don't call onSubmit twice
import { useState, useRef, useCallback } from 'react';
export const useSubmit = (fun: Function) => {
const [isPending, setIsPending] = useState<boolean>(false);
const pendingRef = useRef(null);
const submit = useCallback((...args) => {
if (pendingRef.current) {
return;
}