Skip to content

Instantly share code, notes, and snippets.

View shameemreza's full-sized avatar
🇧🇩
Talk is cheap. Check My Code, Blog and Portfolio.

Shameem Reza shameemreza

🇧🇩
Talk is cheap. Check My Code, Blog and Portfolio.
View GitHub Profile
Verifying that +shameemreza is my blockchain ID. https://onename.com/shameemreza
@shameemreza
shameemreza / gist:76532c6fb781bfed88db274db7708736
Last active June 25, 2017 01:42 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 20px; }
@media (min-width: 768px){
body{ padding-top: 150px; }
}
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; max-width: 650px; margin: 0 auto; }
@shameemreza
shameemreza / linkedlis.c
Created January 26, 2017 09:45
Linked List in C - 4
#include <stdio.h>
typedef struct node {
int val;
struct node * next;
} node_t;
void print(node_t * head) {
node_t * current = head;
printf("***The list begins***\n");
while (current != NULL) {
@shameemreza
shameemreza / linkedlist3.c
Created January 26, 2017 09:48
Linked List in C 3
#include <stdio.h>
typedef struct node {
int val;
struct node * next;
} node_t;
void print(node_t * head) {
node_t * current = head;
printf("***The list begins***\n");
while (current != NULL) {
@shameemreza
shameemreza / linkedlist2.c
Created January 26, 2017 09:51
Linked List in C 2
#include <stdio.h>
typedef struct node {
int val;
struct node * next;
} node_t;
void print(node_t * head) {
node_t * current = head;
while (current != NULL) {
@shameemreza
shameemreza / custom-country-states-woocommerce.php
Created February 3, 2017 16:22
Add states to countries that do not include states in WooCommerce core
<?php
/**
* Add custom states to country in WooCommerce (Ex: Bangladesh)
*/
add_filter( 'woocommerce_states', 'BD_woocommerce_states' );
function BD_woocommerce_states( $states ) {
$states['BD'] = array(
'SS' => __( 'Barandipara', 'woocommerce' ),
);
return $states;
@shameemreza
shameemreza / countryinfo.py
Created March 20, 2017 03:35 — forked from mjrulesamrat/countryinfo.py
Python list of country codes, names, continents, capitals, and pytz timezones
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai
@shameemreza
shameemreza / gist:d2cebb288bf738ae14d633c0c7da23ed
Created March 21, 2017 04:56 — forked from corsonr/gist:0e0a4dfaacf59fdca314
WooCommerce: activate product tabs from URL
<?php
/**
* wc_direct_link_to_product_tabs
*
* Allows you to create custom URLs to activate product tabs by default, directly from the URL
* ex: http://mysite.com/my-product-name#reviews
*/
function wc_direct_link_to_product_tabs() {
if( is_product() ) {
?>
@shameemreza
shameemreza / rate_me_code
Created March 13, 2018 06:57
Android Rate me code
private boolean MyStartActivity(Intent aIntent) {
try
{
startActivity(aIntent);
return true;
}
catch (ActivityNotFoundException e)
{
return false;
}
//Try Google play
intent.setData(Uri.parse("market://details?id=com.cubeactive.qnotelistfree"));
if (!MyStartActivity(intent)) {
//Market (Google play) app seems not installed, let's try to open a webbrowser
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.melopixels.mastiunlimited"));
if (!MyStartActivity(intent)) {
//Well if this also fails, we have run out of options, inform the user.
Toast.makeText(this, "Could not open Android market, please install the market app.", Toast.LENGTH_SHORT).show();
}
}