Skip to content

Instantly share code, notes, and snippets.

@arnaudhuc
arnaudhuc / custom_material_color.dart
Created September 18, 2023 18:41
Custom color flutter
import 'package:flutter/material.dart';
/*
* To use just simple provide the RGB value and call the mdColor straight up
* e.g. mdColor(178, 33, 43),
*/
MaterialColor mdColor(int r, int g, int b) {
Map<int, Color> color = {
50: Color.fromRGBO(r, g, b, .1),
@arnaudhuc
arnaudhuc / settings.json
Created October 4, 2019 09:26
settings.json for validation eslint && stylelint
{
"eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
@arnaudhuc
arnaudhuc / SassMeister-input.scss
Created February 27, 2018 13:48
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
%test {
font-size: 16px;
}
%test2 {

Keybase proof

I hereby claim:

  • I am arnaudhuc on github.
  • I am arnaudhuc (https://keybase.io/arnaudhuc) on keybase.
  • I have a public key whose fingerprint is 261D B531 BE24 0B96 71D6 08B7 02EA 6BBF 93CD 7499

To claim this, I am signing this object:

@arnaudhuc
arnaudhuc / classES2015.js
Last active January 31, 2017 15:44
Test class ES2015
class userName {
constructor(name){
this.name = name;
this.test = "test";
}
render(){
console.log(this.name);
}
}
//var tete = new name('arnaud');
@arnaudhuc
arnaudhuc / scrollToTop.js
Created April 7, 2014 15:29
Zepto Smooth Scroll To Top
var scrollToTop = function() {
var test = setInterval(scrolled, 10);
function scrolled() {
var myvar = $(window).scrollTop() - 70;
$(window).scrollTop(myvar);
if ($(window).scrollTop() <= 0) {
stahpit();
}
console.log('message');
}
function smoothScroll(el, to, duration) {
if (duration < 0) {
return;
}
var difference = to - $(window).scrollTop();
var perTick = difference / duration * 10;
this.scrollToTimerCache = setTimeout(function() {
if (!isNaN(parseInt(perTick, 10))) {
window.scrollTo(0, $(window).scrollTop() + perTick);
smoothScroll(el, to, duration - 10);