Skip to content

Instantly share code, notes, and snippets.

View namuol's full-sized avatar

Lou Acresti namuol

View GitHub Profile
@namuol
namuol / example.coffeex
Last active August 29, 2015 14:08
CoffeeX Syntax Concept (JSX for CoffeeScript)
MySimpleComponent = React.createClass
render: -> <pre>{@props.mytext}</pre>
MyComponent = React.createClass
render: ->
<ul>
@props.items.map (item) =>
<li><a href="#" onClick={@props.handleClick}>{item}</a></li>
</ul>
var Style = require('react-free-style').create()
var BUTTON_STYLE = Style.registerStyle({
backgroundColor: 'red',
padding: 10
})
var ButtonComponent = Style.component(React.createClass({
// You must define `contextTypes` to access `freeStyle`.
@namuol
namuol / SimpleList.js
Last active September 1, 2015 23:35
React Styles
const styles = StyleSheet.create({
list: { /* etc */ },
hover: { /* etc */ },
});
export default class List extends React.Component {
static propTypes = {
style: React.PropTypes.style,
hoverStyle: React.PropTypes.style,
};
The DomainObjectCollection.allObjects() method is deprecated and will be removed in the next version of Gradle. You should use the all() method instead.
FAILURE: Build failed with an exception.
* Where:
Build file '/tmp/groovy-wslite/build.gradle' line: 46
* What went wrong:
A problem occurred evaluating root project 'groovy-wslite'.
Cause: Could not find property 'pgpSecretKeyRingFile' on root project 'groovy-wslite'.
@namuol
namuol / PKGBUILD
Created October 25, 2011 15:33
AUR PKGBUILD for vim-coffee-script-git
# Maintainer: Leif Warner <abimelech@gmail.com>
pkgname=vim-coffeescript-git
pkgver=20110823
pkgrel=1
pkgdesc="CoffeeScript syntax support for Vim."
arch=('any')
url="http://github.com/kchmck/vim-coffee-script"
license=('WTFPL')
depends=('vim')
makedepends=('git')
@namuol
namuol / DCPU.java
Created April 20, 2012 21:26
Decompiled source from http://dcpu.com/highnerd -- modified for DCPU emulation benchmarking.
package computer;
import java.io.*;
// Referenced classes of package computer:
// VirtualMonitor, VirtualKeyboard, AWTKeyMapping
public class DCPU {
public DCPU() {
var gistPrefix = 'http://gist.github.com/',
// Cache document.write so that it can be restored once all Gists have been
// embedded.
cachedWrite = document.write,
body = $('body'),
// Map each p.gist to an object that contains the paragraph to be replaced
// and the Gist's identifier.
gists = $('p.gist').map(function(n, p) {
p = $(p);
@namuol
namuol / split_to_lines.coffee
Created May 1, 2012 03:56
Simple algorithm to split a line of text based on a desired line width. For fixed-width fonts only.
split_to_lines = (str, max_width) ->
lines = []
words = str.split(' ')
current_line = ''
for word in words
if current_line.length + word.length > max_width
lines.push current_line
current_line = word + ' '
else
current_line += word + ' '
var gistPrefix = 'https://gist.github.com/',
// Cache document.write so that it can be restored once all Gists have been
// embedded.
cachedWrite = document.write,
body = $('body'),
// Map each p.gist to an object that contains the paragraph to be replaced
// and the Gist's identifier.
gists = $('a.gist').map(function(n, a) {
a = $(a);
var href = a.attr('href');
function split_to_lines(str, max_width) {
var current_line, lines, word, words, _i, _len;
lines = [];
words = str.split(' ');
current_line = '';
for (_i = 0, _len = words.length; _i < _len; _i++) {
word = words[_i];
if (current_line.length + word.length > max_width) {
lines.push(current_line);
current_line = word + ' ';