Skip to content

Instantly share code, notes, and snippets.

View valmayaki's full-sized avatar
🤠
Happy to be of service to you!

Valentine Ubani Mayaki valmayaki

🤠
Happy to be of service to you!
View GitHub Profile
@valmayaki
valmayaki / index.html
Last active October 29, 2016 15:56
Flat dashboard theme
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<body class="home">
<div class="container-fluid display-table">
<div class="row display-table-row">
<div class="col-md-2 col-sm-1 hidden-xs display-table-cell v-align box" id="navigation">
<div class="logo">
<a hef="home.html"><img src="http://jskrishna.com/work/merkury/images/logo.png" alt="merkery_logo" class="hidden-xs hidden-sm">
<img src="http://jskrishna.com/work/merkury/images/circle-logo.png" alt="merkery_logo" class="visible-xs visible-sm circle-logo">
</a>
</div>
@valmayaki
valmayaki / html_for_international_calling coes.htm
Created November 4, 2016 21:31 — forked from andyj/html_for_international_calling coes.htm
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
@valmayaki
valmayaki / main.css
Created November 13, 2016 04:22
Show fixed header on scroll up
body {
padding-top: 40px;
}
header {
background: #f5b335;
height: 40px;
position: fixed;
top: 0;
transition: top 0.2s ease-in-out;
/* Written by Amit Agarwal */
function getTrackingGIF(account, email, subject) {
var imgURL = "https://ssl.google-analytics.com/collect?"
+ "v=1&t=event"
+ "&tid=" + account
+ "&z=" + Math.round((new Date()).getTime()/1000).toString()
+ "&cid=" + Utilities.getUuid()
@valmayaki
valmayaki / htmlentites.txt
Created November 25, 2016 05:29
html entities
< = &lt; or &#60;
> = &gt; or &#62;
/ = &#47;
] = &#93;
[ = &#91;
" = &quot; or &#34;
' = &#39;
“ = &ldquo; or &#8220;
” = &rdquo; or &#8220;
‘ = &lsquo; or &#8216;
@valmayaki
valmayaki / hhvm.conf
Created November 27, 2016 23:07 — forked from friedemannsommer/hhvm.conf
Takes care about installing NGINX, NGINX-RTMP, NGINX-Pagespeed, LibreSSL, PHP, Composer, Laravel, Symfony, Node, NVM, OhMyZSH
; php options
pid = /var/run/hhvm/pid
; hhvm specific
hhvm.server.file_socket = /var/run/hhvm/hhvm.sock
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.server.user = www-data
@valmayaki
valmayaki / regex.txt
Last active December 6, 2016 14:14
Simple regex
Simple regex
Regex quick reference
[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
$ End of line
\A Start of string
<?php
/** used to generate password parameter for api */
function accessKey($apiKey, $time)
{
$hash = hash_hmac('md5', $time, $apiKey);
return $time. ":". $hash;
}
@valmayaki
valmayaki / index.html
Last active February 27, 2017 18:46
Angular app displays a message when the button is clicked
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<title>Helllo world</title>
</head>
<body>
<div ng-controller="Start as start">
<h1>Fruit default color : {{start.fruit.color}}<h1>
<h1>Apple default color : {{start.apple.color}}<h1>
@valmayaki
valmayaki / woocommerce-virtual-mark-complete.php
Last active March 27, 2020 07:42 — forked from DevinWalker/woocommerce-vitual-mark-complete.php
WooCommerce Mark Virtual Orders as Complete
//Mark Virtual Orders as Complete
add_filter( 'woocommerce_payment_complete_order_status', 'virtual_order_payment_complete_order_status', 10, 2 );
function virtual_order_payment_complete_order_status( $order_status, $order_id ) {
$order = new WC_Order( $order_id );
if ( $order_status == 'processing' &&
( $order->status == 'on-hold' || $order->status == 'pending' || $order->status == 'failed' ) ) {
$virtual_order = true;