Skip to content

Instantly share code, notes, and snippets.

@crysfel
crysfel / gist:1373631
Created November 17, 2011 16:31
ExtJS workaround for scroller issue
Ext.grid.Panel.override({
initComponent : function(){
var me = this;
me.callParent();
me.on('scrollershow', function(scroller) {
if (scroller && scroller.scrollEl) {
scroller.clearManagedListeners();
scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
@debloper
debloper / README.md
Last active May 24, 2017 05:04
Flashing Firefox OS on Flame Reference Devices

Flashing Flame Devices with Firefox OS

If you have a Flame reference device and wanna try out alternate versions of Firefox OS apart from the stock one, but not willing to build from source, then follow this mini-manual.

Get the build

You can download the packages from the Nightly Build directories of Mozilla FTP. You specifically need the following two files:

  • b2g-XX.0a1.en-US.android-arm.tar.gz (XX is the version number)
  • gaia.zip
@ryanseddon
ryanseddon / cli.bash
Created October 9, 2015 05:44
Mocha compiler for css-module support in tests using sass
mocha --compilers js:babel/register,js:./test/css-modules-compiler.js --recursive -w
@kanavarora
kanavarora / bundleAnalysis.js
Last active June 7, 2019 08:24
Simple utility to track your bundle/chunk sizes with each release
/*
Utility to analyze bundle chunks over versions.
Assumes: webpack has already created the bundle summary json file -> stats.json
Parameters:
version: (Optional) a string that labels the current bundle with the version
provided and saves the summary in a csv file.
Output:
If run the first time, generates a csv file bundleAnalaysis.csv, which
@lencioni
lencioni / AsyncComponent.jsx
Created January 8, 2017 17:09
<AsyncComponent> at Airbnb used for Webpack code splitting
// Usage:
//
// function loader() {
// return new Promise((resolve) => {
// if (process.env.LAZY_LOAD) {
// require.ensure([], (require) => {
// resolve(require('./SomeComponent').default);
// });
// }
// });
@developit
developit / *String.prototype.replaceAll() Ponyfill.md
Last active October 11, 2020 23:32
~80b ponyfill for String.prototype.replaceAll()

@developit/replaceall NPM

~80b ponyfill for String.prototype.replaceAll() with good performance.

Why ponyfill? Because this is a proposal for a spec, and polyfilling it in-place before it gets solidified could break code that relies on an incorrect implementation.

Alternate Version
@favadi
favadi / build-emacs.sh
Last active June 5, 2021 15:25
Compile latest emacs version (24.5) in Ubuntu 14.04
#!/bin/bash
# Build latest version of Emacs, version management with stow
# OS: Ubuntu 14.04 LTS
# version: 24.5
# Toolkit: lucid
# Warning, use updated version of this script in: https://github.com/favadi/build-emacs
set -e
@joshwcomeau
joshwcomeau / use-change-log.hook.js
Last active December 12, 2021 04:29
ChangeLog Hook
/**
`useChangeLog` - dev-mode helper hook to let you
know why a memoized component re-rendered!
Usage example:
const YourComponent = React.memo((props) => {
// Just drop this fella into your memo component's body.
useChangeLog(props);
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)
#!/usr/bin/env sh
if [ "$1" != "" ]; then
sBatchList=""
sBatchMessage="$3"
while IFS=, read col1 col2
do
sBatchList="$sBatchList $col1"