Skip to content

Instantly share code, notes, and snippets.

View iAmShakil's full-sized avatar
🎯
Focusing

Shakil Ahmed iAmShakil

🎯
Focusing
View GitHub Profile
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
@iAmShakil
iAmShakil / fix-wordpress-permissions.sh
Last active June 5, 2018 00:52 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@iAmShakil
iAmShakil / ObjectsMergerJavaScript.js
Last active January 22, 2018 18:47
the following function takes the first argument as the base object and adds the following object arguments' items to it. Utilizes es6's spread operator
function mergeObjects(obj, ...others) {
// returning the base object unchanged if no other arguments are provided
if (others.length < 1) return obj;
// looping through the arguments
for (i = 0; i < others.length; i++) {
let theObj = others[i];
// if the current object is not an object or its value is null (typeof null is "object" in js), then console log the error
if (typeof theObj !== "object" || typeof theObj === null) {
@iAmShakil
iAmShakil / sqlimporter.php
Last active August 29, 2015 14:25
Sql importer
<?php
// Name/Path of the file to import
$filename = 'testsqlfile.sql';
// MySQL host
$mysql_host = 'putyourhostnamehere.com';
// MySQL username
$mysql_username = 'testusername';
// MySQL password
$mysql_password = 'testpassword';
// Database name
@iAmShakil
iAmShakil / helloworld
Created June 29, 2014 13:20
simple hello world gist
// creating a simple gist
$(document).ready(function() {
alert("hello world");
});