Skip to content

Instantly share code, notes, and snippets.

View samad-aghaei's full-sized avatar

Samad Aghaei samad-aghaei

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<style>
.myClassName {
width: 600px;
height: 100px;
background: red;
font-size: 20px;
transition: width 2s;
@samad-aghaei
samad-aghaei / script.js
Last active May 8, 2017 06:51
This script can merge two multi-dimensional objects in javascript by comparing given object with the "re-usable" reference one and will remove additional keys nor adding missed parameters along with validation on values. Also it will return the default values in case of no input. IE8 and greater compatible.
/**
This script can merge two multi-dimensional objects in javascript by comparing given object with the "re-usable" reference one and will remove additional keys nor adding missed parameters along with validation on values. Also it will return the default values in case of no input.
IE8 and greater compatible.
**/
var module = (function(){
//To make our reference variable onchangable, have to put it into a function which is fster and more efficient than "JSON.parse(JSON.stringify(VARIABLE))"
var _defs = function(){
return {
//string, number and boolean are actually regex based validation keys on input values.
a: ["string", 'Defaul value for "a"'],
@samad-aghaei
samad-aghaei / index.html
Created May 4, 2017 23:30
This script can merge two multi dimensional associative array/objects in javascript by comparing given object with its reference and will remove additional given keys, adding missed parameteres and also validating values without overhead. Also it will return the default values if no input presented with re-usable reference! Has been tested on IE…
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<body>
<script>
@samad-aghaei
samad-aghaei / cd-twitter.php
Last active August 29, 2015 14:27 — forked from carldanley/cd-twitter.php
CD Twitter Caching
<?php
//------------------------------------------------------------------------------
class CD_Twitter{
protected $_base_twitter_url = 'https://api.twitter.com/1/statuses/user_timeline.json?';
protected $_default_options = array(
'include_entities' => true,
'include_rts' => true,
'screen_name' => 'carldanley',
'count' => 10
);
@samad-aghaei
samad-aghaei / designer.html
Last active August 29, 2015 14:20
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../paper-tabs/paper-tab.html">