Skip to content

Instantly share code, notes, and snippets.

View hpaknia's full-sized avatar

Hassan Paknia hpaknia

  • Illumina
  • Escondido
View GitHub Profile
@DimazzzZ
DimazzzZ / iso-639-1-codes.php
Last active October 17, 2024 18:01 — forked from ddebin/iso_array_lang.php
ISO 639-1 language codes array
<?php
$codes = [
'ab' => 'Abkhazian',
'aa' => 'Afar',
'af' => 'Afrikaans',
'ak' => 'Akan',
'sq' => 'Albanian',
'am' => 'Amharic',
'ar' => 'Arabic',
@we4tech
we4tech / es_result_transformer.js
Created April 9, 2014 09:01
ElasticSearch result transformer example
var data = [],
now = new Date().getTime();
root.hits.hits.forEach(function(hit) {
var d = new Date(),
ts = hit.fields.expired_at_de * 1000;
d.setTime(ts);
var diffInHours = (now - ts) / 1000.0 / 60.0 / 60.0;
@jlbruno
jlbruno / ordinal.js
Last active July 28, 2022 14:58
Javascript Ordinal Numbers
// found here http://forums.shopify.com/categories/2/posts/29259
var getOrdinal = function(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}