Skip to content

Instantly share code, notes, and snippets.

<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),
@gene9
gene9 / dabblet.css
Created June 6, 2019 18:20 — forked from genee19/dabblet.css
Ecwid's loading indicator in pure CSS
/**
* Ecwid's loading indicator in pure CSS
*/
@keyframes move {
from { background-position-x: 0%; }
to { background-position-x: 100%; }
}
#load-indicator {
function test (target: any, propertyKey?: string) {
debugger;
}
class App {
@test foo = 'bar';
}
@gene9
gene9 / generate-pushid.js
Created July 14, 2017 15:51 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@gene9
gene9 / git-cheat-list.md
Created February 17, 2017 13:58
Git cheat list

Git cheat list

  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
  • setting up a character used for comments

git config core.commentchar

@gene9
gene9 / type-inference.cpp
Created December 15, 2016 20:44 — forked from qbit86/type-inference.cpp
Type Inference in C++11
int original = 42;
decltype(original) copy = original;
decltype((original)) reference = original;
original = 1729;
std::cout << copy << std::endl; // 42
std::cout << reference << std::endl; // 1729
#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <memory>
#include <future>
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include <stdint.h>
#include "RLE0DifEncoder.h"
#include <cassert>
#include <stdint.h>
#include <memory>
#include <stdexcept>
///////////////////////////////////////////////////////////////////////////////
namespace matise {
namespace journal {
@gene9
gene9 / TestClrMD.cs
Created September 6, 2016 18:01 — forked from TheXenocide/TestClrMD.cs
In-progress abstraction around accessing heap data using ClrMD
// TODO: encapsulate runtime session, store heap, common general purpose types, stats, etc.
static ClrRuntime _runtime;
void Main()
{
DataTarget _target = DataTarget.LoadCrashDump("C:\\Temp\\MEM.DMP");
_target.SetSymbolPath(Environment.GetEnvironmentVariable("_NT_SYMBOL_PATH"));
var clrVer = _target.ClrVersions[0];
string dac = clrVer.TryGetDacLocation();
#ifndef UNICODE
#define UNICODE
#endif
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <stdio.h>