Skip to content

Instantly share code, notes, and snippets.

View olivoil's full-sized avatar

Olivier Melcher olivoil

View GitHub Profile
@olivoil
olivoil / app_colors_extension.dart
Created November 14, 2023 02:50 — forked from SashaKryzh/app_colors_extension.dart
Flutter ThemeExtension for custom app colors.
import 'package:flutter/material.dart';
/// `ThemeExtension` template for custom colors.
///
/// For example purposes, it has all required fields from the default Material `ColorScheme`.
/// But you can add, rename and delete any fields your need.
///
/// ### Motivation
///
/// At the beginning, you may not know if your colors will fit into the Material `ColorScheme`,
@olivoil
olivoil / flutter_extension_methods.dart
Created November 13, 2023 20:38 — forked from SashaKryzh/flutter_extension_methods.dart
List of my favorite extension methods in Flutter.
import 'package:flutter/material.dart';
extension BuildContextExtensions on BuildContext {
ThemeData get theme => Theme.of(this);
TextTheme get textTheme => theme.textTheme;
ColorScheme get colorScheme => theme.colorScheme;
DefaultTextStyle get defaultTextStyle => DefaultTextStyle.of(this);
@olivoil
olivoil / context.ex
Created November 6, 2023 05:01 — forked from posilva/context.ex
Guardian Authentication with Absinthe GraphQL in Elixir
defmodule Languafy.Web.Context do
@behaviour Plug
import Plug.Conn
alias Languafy.User
def init(opts), do: opts
def call(conn, _) do
case build_context(conn) do
{:ok, context} ->
@olivoil
olivoil / TaskConcurrencyManifesto.md
Created June 7, 2021 19:10 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto
@olivoil
olivoil / README.md
Created May 27, 2021 16:52 — forked from astamicu/Remove videos from Youtube Watch Later playlist.md
Script to remove all videos from Youtube Watch Later playlist

UPDATED 3.12.2020

The old version of youtube with "disable_polymer" is not working anymore, so the script also stopped working.

Thanks to JanTheDeveloper we have a new working script. Big up!

I just changed the '//span[contains(text(),"Watch later")]', to '//span[contains(text(),"Remove from")]', and it should work for any playlist, not just the watch later one. (thanks to hudsonite for the tip)

setInterval(function () {
 document.querySelector('#primary button[aria-label="Action menu"]').click();
@olivoil
olivoil / gh-pages-deploy.md
Created March 5, 2021 18:58 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@olivoil
olivoil / template.yaml
Created May 28, 2020 13:39 — forked from buggy/template.yaml
API Gateway Proxy AppSync
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: SAM Template for API Gateway Proxy AppSync
Parameters:
DomainName:
Type: String
Stage:
Type: String
Default: dev
@olivoil
olivoil / git-auto-sign-commits.sh
Created December 28, 2019 21:28 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@olivoil
olivoil / nextField.dart
Created September 14, 2019 20:18 — forked from escamoteur/nextField.dart
So easy is it now to implement a next field behavior for forms, meaning that the focus is moved as soon the user tabs the next button on the keyboard
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
TabController _tabController;
FocusScopeNode _node = FocusScopeNode(); /// <-----------------
@override
void initState() {
_tabController = TabController(length: 3, vsync: this);
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override