Skip to content

Instantly share code, notes, and snippets.

View robotlolita's full-sized avatar
🐴
everything happens so much oh no

Quil robotlolita

🐴
everything happens so much oh no
View GitHub Profile
# -*- 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 ###
###############################################################################
/*
- 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.
// base.js:
function PluginBase() {
this.something = 1
}
PluginBase.prototype.something = function () {
console.log("in base class")
}
#!/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
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: "" })
}
function SomeObject() {
this.x = 0;
}
SomeObject.prototype = (function() {
return { foo: foo
, bar: bar }
function foo() { return bar() } /* function definition */
function bar() { return foo() }
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!"
#!/bin/bash
echo ">> BUILDING ------------------------------------------------------------"
make clean
make html
echo ">> FIXING --------------------------------------------------------------"
cd build/html
mv _static static
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 }}
}()
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