Skip to content

Instantly share code, notes, and snippets.

View tamimibrahim17's full-sized avatar
🎯
Focusing

Tamim Ibrahim tamimibrahim17

🎯
Focusing
  • Tikweb
  • Bangladesh
View GitHub Profile
@tamimibrahim17
tamimibrahim17 / 0_reuse_code.js
Created April 3, 2017 05:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<pre><?php
// WordPress Multisite - Delete all revisions from all posts in a netword.
// Quick hack by @mrazzari, 2014.
// For context see this thread started by Kitchin at the forums:
// http://wordpress.org/support/topic/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere
// HOWTO
// This snippet is meant to be called as a standalone script.
// Like http://example.com/tmp/multisite_delete_revisions.php
@tamimibrahim17
tamimibrahim17 / wp.sh
Created April 3, 2017 06:08 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@tamimibrahim17
tamimibrahim17 / wp-config.php
Created April 3, 2017 06:10
WordPress: Set WordPress site URL in the config file instead of the database
<?php
// WordPress stores the site URL in the database by default (which I have never
// understood), and it's a pain to have to type out the UPDATE SQL or search in
// phpMyAdmin to change it. This is a simple way to put the URL into
// wp-config.php instead.
// Note that you will still need to update any URLs that appear in the content,
// especially when you copy a database from a development site to production:
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5
@tamimibrahim17
tamimibrahim17 / README.md
Created April 3, 2017 06:11 — forked from raecoo/README.md
Surge config

Install Configurations

  1. Create your own start.conf:
  2. Download rules.conf
  3. Tap start.conf in the configuration list, then tap Start button.

Update Rules

function __construct( $config ) {
$this->providers = $config['providers'];
$this->provider = $config['provider'];
// Actions and filters here
}
/* Common styles for all types */
.bs-callout {
padding: 20px;
margin: 20px 0;
border: 1px solid #eee;
border-left-width: 5px;
border-radius: 3px;
}
.bs-callout h4 {
margin-top: 0;
@tamimibrahim17
tamimibrahim17 / dispatch.py
Created April 26, 2017 11:29 — forked from aortbals/dispatch.py
Synchronize two folders using python.
#! /usr/bin/python
# Dispatch - synchronize two folders
import os
import filecmp
import shutil
from stat import *
class Dispatch:
''' This class represents a synchronization object '''
@tamimibrahim17
tamimibrahim17 / PowerShell-profile.ps1
Created May 23, 2017 05:09 — forked from PierreMage/PowerShell-profile.ps1
Make your Windows command line better with doskey
# http://technet.microsoft.com/en-us/library/ee692685.aspx
# F7 = history
# Alt+F7 = history -c
# F8 = Ctrl+R
Set-Location C:
# Easier navigation
Set-Alias o start
function oo {start .}
@tamimibrahim17
tamimibrahim17 / readme.md
Created October 28, 2017 07:28 — forked from hitautodestruct/readme.md
Generate a custom structure for Wordpress menus.

This gist is for showing an example of a custom wordpress menu.

If you want to get more from the menu item simply have a look at the $item object. i.e:

// Will return a large object with lots of props like title, url, description, id etc.
var_dump( $item );

This code works on Wordpress 4.1.1 as of 31st of March 2015