Skip to content

Instantly share code, notes, and snippets.

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
View Onename verification
Verifying that +shameemreza is my blockchain ID. https://onename.com/shameemreza
@shameemreza
shameemreza / linkedlis.c
Created January 26, 2017 09:45
Linked List in C - 4
View linkedlis.c
#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
View linkedlist3.c
#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
View linkedlist2.c
#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
View custom-country-states-woocommerce.php
<?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
View countryinfo.py
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
View gist:d2cebb288bf738ae14d633c0c7da23ed
<?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 / gist:76532c6fb781bfed88db274db7708736
Last active June 25, 2017 01:42 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
View gist:76532c6fb781bfed88db274db7708736
<!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 / rate_me_code
Created March 13, 2018 06:57
Android Rate me code
View rate_me_code
private boolean MyStartActivity(Intent aIntent) {
try
{
startActivity(aIntent);
return true;
}
catch (ActivityNotFoundException e)
{
return false;
}
View rate_me_code2
//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();
}
}