Skip to content

Instantly share code, notes, and snippets.

View BenoitDuffez's full-sized avatar

Benoit Duffez BenoitDuffez

  • Kerlink
  • Los Angeles greater area, CA, USA
View GitHub Profile
@eculver
eculver / recursive remove .AppleDouble directories
Created May 26, 2011 00:03
recursive remove .AppleDouble directories
find . -name \.AppleDouble -exec rm -rf {} \;
@borichellow
borichellow / BottomNavigationViewExtended.java
Last active July 2, 2017 14:46
extension for BottomNavigationView from Design Support Library
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomNavigationView;
import android.util.AttributeSet;
import android.view.MenuItem;
import javax.annotation.Nonnull;
@pyetti
pyetti / stream_transformer.dart
Created August 6, 2019 22:38
Stream transforms in Dart are too complicated and seem to require the below over and over, if it's not generic. The file below should be useable in any Dart project to transform streams.
import 'dart:async';
/*
* https://api.flutter.dev/flutter/dart-async/Stream/Stream.eventTransformed.html
*
* <S, T>
* S ==> Snapshot type (DocumentSnapshot, QuerySnapshot, et. al.)
* T ==> The type to be returned (Event, List<EventMedia>, et. al.)
*
* This should probably never need to change. It seems to work pretty well.
@kamikat
kamikat / layout.xml
Last active September 1, 2021 17:40
NestedScrollView + SwipeRefreshLayout + RecyclerView
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
@davidgomes
davidgomes / How to change Pantheon Terminal's color scheme.md
Created March 14, 2013 16:53
How to change Pantheon Terminal's color scheme

How to change Pantheon Terminal's color scheme

Many of us spend many hours of our days using their terminal. Plus, we all have different tastes when it comes to color schemes. That's why the ability to change the color scheme of a terminal is one of its more important featuresl. Throughout this tutorial, I'll teach you how you can change the looks of your terminal, step by step.

This tutorial is aimed at elementary OS users, but it also works for any Ubuntu user. Start by installing dconf-tools:

sudo apt-get install dconf-tools

Secondly, you need to decide which theme you're going to apply. You can find dozens of terminal color schemes online, you can even design your own using this web application. Design the color scheme, hit "Get Scheme" and choose "Terminator". You'll get a raw text file with a background color, a foreground color and a palette. Those strings define your color scheme. In this tutorial, I'll post an

@FrankWu100
FrankWu100 / 0000-Enable NETDEV Led Trigger.md
Last active January 20, 2022 22:01
Enable NETDEV Led Trigger

config nodes

/sys/class/leds/<led>/device_name

Specifies the network device name to monitor.

/sys/class/leds/<led>/interval

Specifies the duration of the LED blink in milliseconds. Defaults to 50 ms.

/sys/class/leds//link

@tejastank
tejastank / fix.wkhtmltopdf.odoo.snippetbucket.erp.open.source.seo.sh
Last active August 14, 2022 18:03
Wkhtmltopdf failed (error code: -6). Message: The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display. # https:/…
# https://www.snippetbucket.com/
# ODOO ERP Django PHP Android AngularJS implementation and customization.
# Most Simple and Quick Way:
sudo su
cd /opt
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin/
@MattKetmo
MattKetmo / FooCommand.php
Created September 7, 2012 11:46
[Console] Write into stdout and stderr
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Testcase: app/console foo > std 2> err
*/
@NikolaDespotoski
NikolaDespotoski / RichBottomNavigationView.java
Last active February 13, 2023 23:51
Saving and restoring BottomNavigationView state
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.design.widget.BottomNavigationView;
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.