Skip to content

Instantly share code, notes, and snippets.

View gabriel-laet's full-sized avatar

Gabriel Laet gabriel-laet

View GitHub Profile
/**
* Monkey patch for flash.utils.Dictionary
* @example Basic usage:<listing version="3.0">
* var user:Dictionary = new Dictionary();
* user.name = "Gabriel Laet";
* user.website = "http://gabriellaet.com";
* trace(user.length());
* trace(user.keys());
* trace(user.values());
---
default:
- debug: false
open: public/myapp.swf
applications:
- class: source/classes/Main.as
output: public/myapp.swf
# - class: source/classes/MyOtherApp.as
package
{
public function map(value:Number, startA:Number, endA:Number, startB:Number, endB:Number):Number
{
return startB + (endB - startB) * ((value - startA) / (endA - startA));
}
}
@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
somafm(){ mplayer -vo none -ao sdl http://somafm.com/startstream="$@".pls; }
somafm groovesalad
field error issue solution
Tipo do Registro

Example #1

import React from 'react'

Output

'use strict';

var _interopRequireWildcard = function (obj) { return obj &amp;&amp; obj.__esModule ? obj : { 'default': obj }; };
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
@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"
@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