Skip to content

Instantly share code, notes, and snippets.

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

Apurba Podder apurbajnu

🏠
Working from home
  • Bangladesh , Dhaka
View GitHub Profile
@kasparsd
kasparsd / custom-post-taxonomy-permalinks.php
Created June 13, 2012 15:47
Create permalink structure URLs for custom post types that include all parent terms from a custom taxonomy
<?php
/*
Term Archive Pages:
- http://example.com/recipes/dinner/
- http://example.com/recipes/breakfast,brunch/
Single Recipe Pages:
- http://example.com/recipes/dinner/soup-title/
@bmcculley
bmcculley / password_strength.php
Created March 4, 2014 03:01
Check for password strength, password should be at least n characters, contain at least one number, contain at least one lowercase letter, contain at least one uppercase letter, contain at least one special character.
<?php
$password_length = 8;
function password_strength($password) {
$returnVal = True;
if ( strlen($password) < $password_length ) {
$returnVal = False;
}
@hasinhayder
hasinhayder / envato-screenshots-downloader.php
Last active November 14, 2017 18:37
Download large preview images from the envato item's screenshots page
#!/usr/bin/env php
<?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';
@garveen
garveen / bigfileUpload.php
Last active April 4, 2022 17:56
using html 5 APIs, slice big file into blob and upload
<?php
/*
you may modify:
php:
filename
file max size
buf size
how long to wait
@kjohnson
kjohnson / ninja-forms-add-email-attachment.php
Created March 13, 2015 15:37
Add an Attachment to Email Notifications in Ninja Forms
<?php
/*
Plugin Name: Ninja Forms Email Attachment
*/
function add_my_attachment( $attachments ) {
$attachments[] = 'server_path_to_my_file';
return $attachments;
}
@benjasHu
benjasHu / jquery-plugin.js
Last active March 13, 2021 07:36
ES6 Module jQuery Plugin Definition
import pluginify from 'pluginify';
class Plugin {
constructor() {
/* ... */
}
}
/*
Convert plugin class into a jQuery plugin
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active February 9, 2025 08:41
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rayrutjes
rayrutjes / ais-wp.css
Created July 7, 2016 12:48
Some boilerplate to create an instantsearch.js search experience in your WordPress theme. This works in combination with the Algolia Search plugin for WordPress.
#ais-wrapper {
display: flex;
}
#ais-main {
padding: 1rem;
width: 100%;
}
{
"Kwajalein":"(GMT-12:00) International Date Line West",
"Pacific\/Midway":"(GMT-11:00) Midway Island",
"Pacific\/Samoa":"(GMT-11:00) Samoa",
"Pacific\/Honolulu":"(GMT-10:00) Hawaii",
"America\/Anchorage":"(GMT-09:00) Alaska",
"America\/Los_Angeles":"(GMT-08:00) Pacific Time (US & Canada)",
"America\/Tijuana":"(GMT-08:00) Tijuana, Baja California",
"America\/Denver":"(GMT-07:00) Mountain Time (US & Canada)",
"America\/Chihuahua":"(GMT-07:00) Chihuahua",
@hasinhayder
hasinhayder / charlie-foxtrot.go
Last active May 20, 2020 19:16
converts a string to NATO phonetic alphabet equivalents
/* Charlie Foxtrot - If You Know What It Means ;) */
package main
import (
"fmt"
"strings"
"bufio"
"os"
)