Skip to content

Instantly share code, notes, and snippets.

View helielson's full-sized avatar

Helielson helielson

  • Indaband, Frontend Bahia
  • Salvador, Brazil
View GitHub Profile
@lukepighetti
lukepighetti / extents_page_view.dart
Last active January 3, 2023 13:48
Flutter PageView that loads the next/previous page off-screen
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart' hide PageView;
/// This is copy-pasted from the Flutter framework with a support added for building
/// pages off screen using [Viewport.cacheExtents] and a [LayoutBuilder]
///
/// Based on commit 3932ffb1cd5dfa0c3891c60977ee4f9cd70ade66 on channel dev
// Having this global (mutable) page controller is a bit of a hack. We need it
@LFSCamargo
LFSCamargo / AnimatedGate.tsx
Created May 30, 2019 01:48
Animated Twitter LaunchScreen
import * as React from 'react'
import { Animated, Easing, StatusBar, MaskedViewIOS, View, ViewStyle } from 'react-native'
import icons from '../../icons'
import lightTheme from '../../config/theme'
interface Props {
bootstraped: boolean
}
const AnimatedGate: React.FunctionComponent<Props> = (props) => {
@sibelius
sibelius / useEventEmitter.tsx
Created April 16, 2019 01:20
UseEventEmitter hook to work with react navigation navigationOptions buttons
import { useEffect, useRef } from 'react';
export const useEventEmitter = (eventEmitter, eventName: string, fn: () => void) => {
const subscription = useRef(null);
useEffect(() => {
subscription.current = eventEmitter.addListener(eventName, fn);
return () => {
if (subscription.current) {
// Based on https://github.com/facebook/relay/blob/master/packages/react-relay/modern/ReactRelayQueryRenderer.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
@Piasy
Piasy / install_ffmpeg.sh
Last active April 14, 2024 05:40
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@TheLarkInn
TheLarkInn / explanation.md
Last active June 7, 2018 13:33
Understanding some CommonsChunksPlugin teqniques

When you use the names property in the CommonsChunkPlugin({}) and pass an array as the value, webpack converts what is seen below:

      new webpack.optimize.CommonsChunkPlugin({
        names: ['app', 'vendor', 'manifest'],  // creating manifest.js 
        minChunks: Infinity
      })

Into:

import ReactDOM from 'react-dom';
const componentToString = function(node) {
let el = document.createElement('div');
ReactDOM.render(node, el);
return el.innerHTML;
};
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)
@jkneb
jkneb / Gruntfile.js
Last active December 23, 2015 07:09
grunt-ember-templates plugin configuration for the Gruntfile + package.json. You'll have to update the Gruntfile with YOUR correct path to templates files. 1. Run `npm install` 2. Run `grunt` or `grunt watch`
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
emberTemplates: {
compile: {
options: {
templateBasePath: /assets\/js\/app\/templates\//
},
files: {