Skip to content

Instantly share code, notes, and snippets.

View jiromm's full-sized avatar

Aram Baghdasaryan jiromm

View GitHub Profile
@jiromm
jiromm / gist:5387374
Last active April 15, 2022 00:51
Get Rates from CBA bank of Armenia
<?php
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
define('WSDL', 'http://api.cba.am/exchangerates.asmx?wsdl');
$error = false;
try {
@jiromm
jiromm / category_tree.php
Created July 18, 2013 08:19
Category Tree
<?php
$nodeList = array();
$tree = array();
$query = mysql_query("SELECT category_id, name, parent FROM categories ORDER BY parent");
while ($row = mysql_fetch_assoc($query)){
$nodeList[$row['category_id']] = array_merge($row, array('children' => array()));
}
mysql_free_result($query);
@jiromm
jiromm / HTML5 Starter Template
Created September 29, 2013 19:25
When starting a new project, you need a starter template. Here is a concise and clean template to serve as a basis for your HTML5 projects.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@jiromm
jiromm / Base64 Encode of a 1*1px “spacer” gif
Created September 29, 2013 19:26
I don’t recommend using transparent “spacer” gifs, but I know that even in 2013, many people are still using them from time to time. If you’re one of them, you’ll probably enjoy this Base64 encode of a 1*1px “spacer” gif. Way better than using an image.
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
@jiromm
jiromm / Valid flash embed
Created September 29, 2013 19:27
Are you often embedding Flash files into your html pages? If yes, you’ll better save the valid flash embed code below for future use.
<object type="application/x-shockwave-flash"
data="your-flash-file.swf"
width="0" height="0">
<param name="movie" value="your-flash-file.swf" />
<param name="quality" value="high"/>
</object>
@jiromm
jiromm / HTML5 video with Flash fallback
Created September 29, 2013 19:27
Another great feature of the new HTML5 specification is definitely the video tag which allows you to easily embed video files. But unfortunately, some browsers can’t deal with embedded HTML5 video. So here is a complete code with a flash fallback for older browsers.
<video width="640" height="360" controls>
<source src="__VIDEO__.MP4" type="video/mp4" />
<source src="__VIDEO__.OGV" type="video/ogg" />
<object width="640" height="360" type="application/x-shockwave-flash" data="__FLASH__.SWF">
<param name="movie" value="__FLASH__.SWF" />
<param name="flashvars" value="controlbar=over&amp;image=__POSTER__.JPG&amp;file=__VIDEO__.MP4" />
<img src="__VIDEO__.JPG" width="640" height="360" alt="__TITLE__"
title="No video playback capabilities, please download the video below" />
</object>
</video>
@jiromm
jiromm / iPhone call & sms links
Created September 29, 2013 19:28
With the release of the iPhone, Apple introduced a quick way to create call and sms links. Here is a sample code to keep in your snippet library.
@jiromm
jiromm / force_download.html
Last active December 24, 2015 06:09
HTML5 force download a file
<!-- will download as "expenses.pdf" -->
<a href="/files/expense.pdf" download="expenses.pdf">Download Your Expense Report</a>
@jiromm
jiromm / crash_ie6.html
Last active December 24, 2015 06:09
Crash IE6
<style>
* {
position: relative
}
</style>
<table>
<input>
</table>
@jiromm
jiromm / context_menu.html
Last active December 24, 2015 06:18
HTML5 context menu
<section contextmenu="mymenu">
<p>Yes, this section right here</p>
</section>
<menu type="context" id="mymenu">
<menuitem label="Please do not steal our images" icon="img/forbidden.png"></menuitem>
<menu label="Social Networks">
<menuitem label="Share on Facebook" onclick="window.location.href = 'http://facebook.com/sharer/sharer.php?u=' + window.location.href;"> </menuitem>
</menu>
</menu>