Skip to content

Instantly share code, notes, and snippets.

View ashawkat's full-sized avatar
🏠
Working from home

Adnan Shawkat ashawkat

🏠
Working from home
  • CodeHeaven
  • Dhaka, Bangladesh
View GitHub Profile
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
@ashawkat
ashawkat / Get Country Names
Created November 30, 2022 07:25
A function returning an array of all the countries
function get_country_names() {
$countryArray = [
"AF" => "Afghanistan",
"AX" => "Åland Islands",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
@ashawkat
ashawkat / gist:79962843522559d1de81adfeccb528d7
Created February 17, 2020 16:56 — forked from turtlepod/gist:5203512
Settings Class with Metabox
<?php
/* Prevent loading this file directly and/or if the class is already defined */
if ( ! defined( 'ABSPATH' ) || class_exists( 'MYFX_Settings_Class' ) )
return;
/**
* Settings with Meta Boxes
* Helper class to easily create settings page for plugin or theme with Meta Box API.
*
@ashawkat
ashawkat / media-query.css
Created January 13, 2020 11:03 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@ashawkat
ashawkat / media-query.css
Created January 13, 2020 11:03 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
<?php
/* Demo Data Import Setup */
if ( !function_exists( 'your_theme_import_data_setup' ) ){
function charityo_import_data_setup( $default_settings ) {
$default_settings['parent_slug'] = 'themes.php';
$default_settings['page_title'] = esc_html__( 'Demo Import' , 'charityo' );
$default_settings['menu_title'] = esc_html__( 'Import Demo Data' , 'charityo' );
$default_settings['capability'] = 'import';
$default_settings['menu_slug'] = 'demo-import';
<?php
#!/usr/bin/env php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
set_time_limit(0);
$dir = $argv[1];
$source = $argv[2];
print_r($argv);
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';

jQuery / Twitter Bootstrap List Tree Plugin

Demo: http://jsfiddle.net/clayzermk1/QD8Hs/

Overview

I needed a simple plugin to build a two-tier collapsible list with checkboxes. I wanted it to fit well with Twitter's Bootstrap. I couldn't find one that was simple enough. I hope you enjoy =) Feel free to send feedback.

@ashawkat
ashawkat / eloquent.md
Created February 12, 2014 17:36 — forked from msurguy/eloquent.md

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@ashawkat
ashawkat / boots_assets_css_bootstrap.css
Created December 29, 2013 17:51
Boots a ghost template for Ghost CMS
/*!
* Bootstrap v3.0.0
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/