Skip to content

Instantly share code, notes, and snippets.

View logicaroma's full-sized avatar

Ramin Mohammadi logicaroma

View GitHub Profile
/*
saves the configuration of all accounts to the server.
*/
saveSettings: function() {
var accounts = this.get('Accounts'),
payload = [];
//process each account and add the items to the payload
accounts.forEach(function (item) {
// pick the needed keys for the payload
var handleVisibility = function(){
if ( document.hidden ) {
// The page is hidden.
Store.set('app:hidden', Date.now());
} else if( Store.has('rabobank:app:hidden') ){
// The page is visible and has a timestamp saved.
var timestamp = new Date(Store.get('app:hidden')),
maxTimePassedAllowed = 1000 * 60 * 2,
isPast = (new Date().getTime() - timestamp < maxTimePassedAllowed) ? false : true;
@logicaroma
logicaroma / flexbox_mixin.md
Created December 21, 2013 04:35
scss mixin for flexbox

SCSS Flexbox Helpers

@mixin flexbox() {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
}
@logicaroma
logicaroma / Overview.md
Created November 18, 2013 15:48
Some Notes on the next client-ui release

Based on the latest UX designs we now have a list of components that we need to add/ improve in client-ui 0.2.x.

This release will introduce the following new/ updated components

  • Used for creating popups (a view only presented as a modal dialog),
  • Notifications in form of a HUD

Forms

@logicaroma
logicaroma / Element.js
Last active April 26, 2024 04:53
some extra utils on the Element obj
Element.prototype.hasClass = function (className) {
return new RegExp(' ' + className + ' ').test(' ' + this.className + ' ');
};
Element.prototype.addClass = function (className) {
if (!this.hasClass(className)) {
this.className += ' ' + className;
}
};
/** A simple Node.js script to instantly serve
* Processing source code as Processing.js :)
*
* This is an enhanced version which pre-procs
* the code, so each of the clients does not
* have to translate the PDE Java code into
* PJS. The server will re-load the file only
* if it has changed, in the first version
* that had been reloaded on each GET request!
*
@logicaroma
logicaroma / FM_Lab_1.md
Created September 22, 2013 21:39
FM Lab: Web Experiments Sandbox

WebCam

Experimenting with HTML5, webcam access and cavas. Using some basic motion detection / frame-differencing scripts to draw circles in regions where motion above a certain threshold is detected. You can toggle whether camera colours or red is used for the circles.

Multi Device

Playground explores the potential for simple multiplayer gaming using mobile devices anywhere crowds congregate. This prototype is for up to 5 players.

Technology: webrtc, websockets, accelerometer, geolocation, canvas and more

OpenFrameworks

@logicaroma
logicaroma / head.html
Created August 14, 2013 23:51 — forked from nikmd23/gist:1981339
some usefull stuff in your header
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- IE10 Plug-in setting
Including this tag will force plug-in-less "Metro IE10" to prompt the user to open the URL in "Desktop IE10" which supports plug-ins.
@logicaroma
logicaroma / _icons-functions.scss
Created August 14, 2013 23:41
Two examples of sass modules for loading icons. one uses functions to automatically render css for the icons second includes %placeholder for the generic styling of an icon
//function to load icons images
@function icon-url($name) {
@return url(‘/assets/images/icon-#{$name}.png’);
}
// var with icons
$icons: (open close message comment);
//the functions which creates classes for the icons
@each $icon in $icons {
.icon-#{$icon} {
@logicaroma
logicaroma / .aliases.md
Created August 14, 2013 23:17
alias shortcuts for osx and git terminal commands

Easier navigation: .., ..., ...., ....., ~ and -

alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias ~="cd ~" # cd is probably faster to type though alias -- -="cd -"

Shortcuts

alias d="cd ~/Documents/Dropbox"