Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Shakil Ahmed iAmShakil

Block or report user

Report or block iAmShakil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View building-redux--step-4.js
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
View building-redux--step-6.js
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
View building-redux--step-5.js
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
View building-redux--step-4.js
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
View building-redux--step-3.js
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
View building-redux--step-2.js
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
View building-redux.js
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
View fix-wordpress-permissions.sh
#!/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 Jan 22, 2018
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
View ObjectsMergerJavaScript.js
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) {
View sqlimporter.php
<?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
You can’t perform that action at this time.