Skip to content

Instantly share code, notes, and snippets.

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

Kawsar Ahmad itskawsar

🏠
Working from home
  • Dhaka, Bangladesh
View GitHub Profile
@itskawsar
itskawsar / entypo.css
Last active December 30, 2015 21:29 — forked from pnull/entypo.css
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
diff -ru readykommerce-multi-newsletter-signup-light-orig/nl_signup.php readykommerce-multi-newsletter-signup-light/nl_signup.php
--- readykommerce-multi-newsletter-signup-light-orig/nl_signup.php 2014-02-13 09:40:23.000000000 -0500
+++ readykommerce-multi-newsletter-signup-light/nl_signup.php 2014-03-12 12:58:08.000000000 -0400
@@ -278,13 +278,13 @@
// If is the home page, an archive, or search results
if(is_front_page() || is_archive() || is_search() || is_single() || is_page()) :
global $post;
- // $content = $post->post_excerpt;
+
$file = get_post_meta( $post->ID, 'nl_file_upload', true );
<?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';
@itskawsar
itskawsar / gist:53b66273e43f1c007f08
Created December 10, 2015 14:23 — forked from MindyPostoff/gist:a10148daa110119b262f
Change "Proceed to PayPal" Text on Checkout Button in WooCommerce
/* Change the "Proceed to PayPal" button text in the WooCommerce checkout screen
* Add this to your theme's functions.php file
*/
add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 );
function custom_paypal_button_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Proceed to PayPal' :
$translated_text = __( 'NEW BUTTON TEXT', 'woocommerce' );
break;
}
@itskawsar
itskawsar / seconds-human-redable-text.php
Created December 30, 2015 19:24
Seconds to human readable text
<?php
/*
* Convert seconds to human readable text.
* Found at: http://csl.sublevel3.org/php-secs-to-human-text/
*
*/
function secs_to_h($secs)
{
$units = array(
@itskawsar
itskawsar / gist:3213704a9c45fd1e7401b4d05c110d9d
Created January 30, 2017 12:09 — forked from niczak/gist:2501891
PHP Encrypt/Decrypt Class
<?php
class Encryption {
var $skey = "yourSecretKey"; // change this
public function safe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='),array('-','_',''),$data);
return $data;
}
@itskawsar
itskawsar / openssl_encrypt_decrypt.php
Created January 30, 2017 12:09 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@itskawsar
itskawsar / hosts
Created August 30, 2017 10:26 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@itskawsar
itskawsar / airports.sql
Created December 28, 2017 07:29 — forked from tanerdogan/airports.sql
airports.sql - airport list (total 8800 airport)
This file has been truncated, but you can view the full file.
DROP TABLE IF EXISTS `airports`;
CREATE TABLE IF NOT EXISTS `airports` (
`code` varchar(50) COLLATE utf8_turkish_ci DEFAULT NULL,
`name` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`cityCode` varchar(50) COLLATE utf8_turkish_ci DEFAULT NULL,
`cityName` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`countryName` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`countryCode` varchar(200) COLLATE utf8_turkish_ci DEFAULT NULL,
`timezone` varchar(8) COLLATE utf8_turkish_ci DEFAULT NULL,