Skip to content

Instantly share code, notes, and snippets.

View gabriel-laet's full-sized avatar

Gabriel Laet gabriel-laet

View GitHub Profile
@gabriel-laet
gabriel-laet / babel-dynamic-import-webpack-chunk-chame.js
Created June 12, 2017 18:47
POC: Babel plugin that automatically adds webpack's magic comment containing chunk name for dynamic imports
/*
Looks for dynamic imports and adds a comment
containing webpack's magic comment syntax
https://webpack.js.org/guides/code-splitting-async/#chunk-names
*/
const {basename} = require('path');
const TYPE_IMPORT = 'Import';
const WEBPACK_CHUNK_NAME = 'webpackChunkName';
@gabriel-laet
gabriel-laet / _webpack-example.md
Last active February 7, 2016 15:24
webpack setup example

Just an example of how you can make your webpack config more declarative an re-usable.

You can have a generic webpack.config.js that includes most of your common setup (loaders, plugins and all that) and an attribute in your project's package.json (or anywhere you think it makes sense) containing your project's entries or any other setup you might want to change.

  • npm start - live reload, http://localhost:8000
  • npm run build - build to dist folder
  • npm run build -- -p - production build to folder
  • npm run watch - watch to dist folder
@gabriel-laet
gabriel-laet / idea.sh
Created June 2, 2015 03:06
Set IntelliJ HIDPI flag according to scaling-factor
--- bin/idea.sh 2015-06-02 00:03:02.869607320 -0300
+++ bin/idea.sh 2015-06-02 00:01:59.867708731 -0300
@@ -171,6 +171,12 @@
CLASSPATH="$CLASSPATH:$IDEA_CLASSPATH"
fi
+# Define HIDPI flag
+SCALE_FACTOR=$(gsettings get org.gnome.desktop.interface scaling-factor | sed 's/uint32\ //')
+if [ "$SCALE_FACTOR" = 2 ]; then
+ HIDPI_PROPERTIES="-Dhidpi=true"
set -g utf8
set-option -g default-shell /bin/zsh
set-window-option -g utf8 on
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# set scrollback history to 10000 (10k)
set -g history-limit 10000

Example #1

import React from 'react'

Output

'use strict';

var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
field error issue solution
Tipo do Registro
somafm(){ mplayer -vo none -ao sdl http://somafm.com/startstream="$@".pls; }
somafm groovesalad
@gabriel-laet
gabriel-laet / bulkloader_lazyfile.py
Created November 19, 2013 20:03
Old but still useful script to create BulkLoader's XML file
#!/usr/bin/env python
# encoding: utf-8
"""
bulkloader_lazyfile.py
Created by gabriellaet on 2008-05-14.
Copyright (c) 2008 Gringo. All rights reserved.
"""
import os, sys
package
{
public function map(value:Number, startA:Number, endA:Number, startB:Number, endB:Number):Number
{
return startB + (endB - startB) * ((value - startA) / (endA - startA));
}
}
---
default:
- debug: false
open: public/myapp.swf
applications:
- class: source/classes/Main.as
output: public/myapp.swf
# - class: source/classes/MyOtherApp.as