This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
############################################################################### | |
### ~efl-ttt.game~ ### | |
### '''''''''''''' ### | |
### Simple tic-tac-toe game in Python using EFL/Elementary. ### | |
### ### | |
### ### | |
### Copyright (c) 2011 Quildreen Motta // Licenced under MIT/X11 ### | |
############################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
- Less noises. No semicolons or braces, unless strictly needed. | |
- Braces shouldn't be on a line of their own, unless they close a | |
function. | |
- No strict comparison operator, unless strictly needed. | |
- Form feed characters to separate pages of the code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// base.js: | |
function PluginBase() { | |
this.something = 1 | |
} | |
PluginBase.prototype.something = function () { | |
console.log("in base class") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2010 Quildreen <http://www.mottaweb.com.br/> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the "Software"), | |
# to deal in the Software without restriction, including without limitation | |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
# and/or sell copies of the Software, and to permit persons to whom the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function beasFadeSlideShow(tag, images) { | |
var mygallery=new fadeSlideShow({ wrapper_id: tag | |
, dimensions: [500, 333] | |
, image_array: images.slice(0) | |
, display_mode: {type: 'auto', pause: 2500, cycles: 0, wrap_around: false} | |
, fade_duration: 500 | |
, desc_reveal: "ondemand" | |
, toggler_id: "" }) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SomeObject() { | |
this.x = 0; | |
} | |
SomeObject.prototype = (function() { | |
return { foo: foo | |
, bar: bar } | |
function foo() { return bar() } /* function definition */ | |
function bar() { return foo() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Mage(name) { | |
this.name = name | |
} | |
Mage.prototype = function() { | |
return { cast: cast | |
, meditate: meditate } | |
function cast(spell, can) { | |
if (can) return this.name + " cast " + spell | |
else return "Nothing happens!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo ">> BUILDING ------------------------------------------------------------" | |
make clean | |
make html | |
echo ">> FIXING --------------------------------------------------------------" | |
cd build/html | |
mv _static static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj = function() { | |
// local variables, since a function creates a new scope binding, they can only | |
// be acessed inside this function (and any function that is defined inside this function) | |
var x = 1, y = 2 | |
// The return value is anything you want exposed to the outside world, that will | |
// be referenced by `obj'. You could also return a primitive here, instead of an object | |
return { sum: function() { return x + y }} | |
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Something(overwrite) { | |
if (overwrite) | |
this.foo = 'bar' // foo will be `bar' only for this object | |
} | |
// On the prototype you define properties that should be shared by everything. | |
Something.prototype = { bar: function(){ return this.foo } | |
, foo: 'baz' } | |
var x = new Something |