Skip to content

Instantly share code, notes, and snippets.

View akoppela's full-sized avatar

Andrey Koppel akoppela

View GitHub Profile
Gamepon.Widget.Timer = new Class({
options: {
actions: {
timer: {
enable: function() {
var time = this.element.get('html').split(':');
this.seconds = time[2].toInt() + (time[1] * 60).toInt() + (time[0] * 3600).toInt();
this.decrementTime.periodical(1000, this);
},
disable: function() {
IGC.Widget.Select = new Class({
options: {
tag: 'select',
pseudos: Array.object('focusable', 'value', 'form-associated'),
states: Array.fast('collapsed'),
events: {
self: {
set: function(item) {
this.setValue(item.getValue());
this.write(item.getTitle(), true);
/*
---
script: Select.js
description: Basic selectbox
license: Public domain (http://unlicense.org).
authors: Yaroslaff Fedin
[submodule "public/javascripts/Packages/qfocuser"]
path = public/javascripts/Packages/qfocuser
url = git://github.com/Inviz/qfocuser.git
[submodule "public/javascripts/Packages/mootools-custom-event"]
path = public/javascripts/Packages/mootools-custom-event
url = git://github.com/cpojer/mootools-custom-event.git
[submodule "public/javascripts/Packages/art"]
path = public/javascripts/Packages/art
url = git://github.com/kamicane/art.git
[submodule "public/javascripts/Packages/mootools-color"]
name: Giftofoni
filename: giftofoni.js
license: Public domain, http://unlicense.org
copyright: Koppel Andrey
author: lastdrop
category: Interface
sources:
- Source/Application.js
[submodule "app/assets/javascripts/Packages/qfocuser"]
path = app/assets/javascripts/Packages/qfocuser
url = git://github.com/lovelyscalabledrawings/qfocuser.git
[submodule "app/assets/javascripts/Packages/mootools-custom-event"]
path = app/assets/javascripts/Packages/mootools-custom-event
url = git://github.com/cpojer/mootools-custom-event.git
[submodule "app/assets/javascripts/Packages/art"]
path = app/assets/javascripts/Packages/art
url = git://github.com/kamicane/art.git
[submodule "app/assets/javascripts/Packages/mootools-color"]
>> Fb.new(User.first.token).friends
User Load (0.3ms) SELECT `users`.* FROM `users` LIMIT 1
get https://graph.facebook.com/me/friends?access_token=AAACR6sxig9cBAFnlu6MysWGIGgklHCxYKOZBKnYJwy8lnEeLGWXwZA4z0TEZAZAh2uQY4d50MopZCuaVemIAzS85miFBSU3H8kDLAHPaTkgZDZD&fields=first_name%20%2Clast_name%20%2Cbirthday%20%2Cbio%20%2Cgender%20%2Clocale%20%2Cverified%20%2Ctimezone%20%2Cusername
200
access-control-allow-origin: "*"
cache-control: "private, no-cache, no-store, must-revalidate"
content-type: "text/javascript; charset=UTF-8"
etag: "\"8ae1b5c525d219d2f3c5e83be46e67b2700de17d\""
expires: "Sat, 01 Jan 2000 00:00:00 GMT"
%menu#first-menu{:type => 'list'}
%li{:value => '1'} 1
%li{:value => '2'} 2
%li{:value => '3'} 3
%menu#second-menu{:type => 'list', :target => '$$ #first-menu :set()'}
%li{:value => '1'} 1
%li{:value => '2'} 2
%li{:value => '3'} 3
{-| Takes two maybe values and maybe test. Returns first maybe value if test is just true.
Otherwise returns second maybe value if test is just false.
-}
maybeAndWhenOrHelper : Maybe a -> Maybe a -> Maybe Bool -> Maybe a
maybeAndWhenOrHelper maybeValueWhen maybeValueWhenNot =
let
doTest test =
if test then
maybeValueWhen
else
{-| Returns just true if given maybe is just something.
Otherise returns just false if given maybe is nothing.
maybeAndToBool (Just 42) == Just True
maybeAndToBool Nothing == Just False
-}
maybeAndToBool : Maybe a -> Maybe Bool
maybeAndToBool maybe =
case maybe of
Just _ ->