This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `states` ( | |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | |
`iso` varchar(10) DEFAULT '0', | |
`code` varchar(10) DEFAULT '0', | |
`name` varchar(255) DEFAULT '0', | |
`category` varchar(50) DEFAULT '0', | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; | |
INSERT INTO `states` (`id`, `iso`, `code`, `name`, `category`) VALUES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$session_id = session_id(); | |
$current_date = date('Y-m-d', strtotime('now')); | |
$db = new SQLite3('attendance.sqlite3'); | |
$db->exec("CREATE TABLE IF NOT EXISTS attendance ( | |
user_session varchar(50), | |
user_datetime varchar(100), | |
visit INT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Based on http://stackoverflow.com/questions/17246991/parse-retrieve-more-then-1000-rows/17288679#17288679 | |
function getAllRecords($className, $loopCount=0, $result=array()) | |
{ | |
$limit = 100; | |
$query = new ParseQuery($className); | |
$query->limit($limit); | |
$query->skip($limit * $loopCount); | |
try{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_cart_item_thumbnail', 'get_attr_image', 10, 3); | |
function get_attr_image($image, $item, $item_key) | |
{ | |
$img_url = array_shift( wc_get_product_terms( $item['product_id'], 'pa_image', array( 'fields' => 'names' ) ) ); | |
if($img_url) | |
{ | |
$dom = new DOMDocument(); | |
$dom->loadHTML($image); | |
$node = $dom->getElementsByTagName('img'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
list of files in a folder | |
cache/feeds/my_feed.json | |
cache/feeds/us_feed.json | |
cache/feeds/uk_feed.json | |
..... | |
*/ | |
var glob = require('glob'); | |
var countries = glob.sync('cache/feeds/?([a-z])?([a-z])_feed.json').map(function(obj){ | |
return obj.split('_')[0] // ['cache/feeds/uk', 'feed.json'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"7219.KL":{"symbol":"7219.KL","end":null,"start":null,"timestamp":[1583110800,1583197200,1583283600,1583370000,1583456400,1583715600,1583802000,1583888400,1584061200,1584320400,1584406800,1584493200,1584579600,1584666000,1585011600,1585098000,1585184400,1585270800,1585530000,1585616400,1585875600,1586134800,1586221200,1586307600,1586394000,1586480400,1586739600,1586826000,1586998800,1587085200,1587344400,1587430800,1587517200,1587603600,1587690000,1587949200,1588035600,1588122000,1588208400,1588554000,1588640400,1588726800,1588899600,1589245200,1589331600,1589418000,1589504400,1589763600,1589850000,1589936400,1590022800,1590109200,1590541200,1590627600,1591146000,1591232400,1591318800,1591664400,1591750800,1591837200,1591923600,1592182800,1592269200,1592355600,1592442000,1592528400,1592787600,1592874000,1592960400,1593046800,1593133200,1593392400,1593478800,1593565200,1593651600,1593738000,1593997200,1594083600,1594170000,1594256400,1594342800,1594602000,1594688400,1594774800,1594861200,1594947600,1595206800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
require('dotenv').config() | |
class PodcastPlayer { | |
constructor(){ | |
var self = this; | |
this.podcast_logo = process.env.BASE_URL + require('~/podcast.png'); | |
this.podcast_logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAHdElNRQfkBgoENB7n0IC4AAAC/UlEQVRIx5WUS2xVVRSGv317K7nQwlXDs23EkggmQBOIUOZITRhh5RErKMQJpsY4NpIYZoxoQkxqIgUsyQ06wAafCY+RPIK0CD7KBAmQQBHogwChl/M5uMfbnt5TrWt0zlrr//bae629A6lmE2/QzHKmk+M6VzlFT+hjauZaT5tmP7m2MjtMEM+kky0AnOVHLnAHmM0KWlgFQDc7w4PJ1673oqpfu7QittweVX91/mTyvP3qiJsBDK70Qzvc4we+EmdscUS95PNp8uB36lAp2VYvJ/b/m60ANjus9qQB3lQjXwOrPahqZK8FC/YZqXrIaeB6I/XtifJp/ql+CgaPqNptYzna6GFVj5gBO9WrZpOADepD54E7VW2vqPB9Vd8D5/tQ3ZQMf6V+AdY4oO6NvS12uNd18V+HetfpYLdaSAL+Ul8H31LvOwsMdpWPcL8BnOWgug3cqA44NkPOU/UF8IB6AMB3E13YAfHKB8FFqs4ByABQB8h14CXgIgDvJErcDkAv0AhcA2DuGACgGCKgGngMQD4BeBaAR0AOQpEIqBkDPAKqzQO3gQYAzicA5yCO3AafIwMMjZ3BMz5Rm |