Skip to content

Instantly share code, notes, and snippets.

View danielt69's full-sized avatar
:octocat:
Focusing

Daniel danielt69

:octocat:
Focusing
View GitHub Profile
#!/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
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@danielt69
danielt69 / deploy.sh
Last active August 29, 2015 14:20 — forked from nodesocket/deploy.sh
BASE_PATH="/srv/www"
REPO_PATH="/srv/www/repo"
GIT_URL="https://github.com/username/repo.git"
if [ -d "$REPO_PATH" ]; then
cd $REPO_PATH
git pull --quiet
echo "git pull successfully ran ($(git rev-parse --short HEAD))";
else
cd $BASE_PATH
@danielt69
danielt69 / 0_reuse_code.js
Created November 1, 2015 15:23
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
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="icon" href="/favicon.ico"> -->
<!-- Latest compiled and minified CSS -->
@danielt69
danielt69 / Detect IE (up to version 12 and Edge).js
Last active November 4, 2016 18:57
Detect IE (up to version 12 and Edge)
// detect IE
var IEversion = detectIE();
if (IEversion !== false) {
// document.getElementById('result').innerHTML = 'IE ' + IEversion;
document.getElementsByTagName("body")[0].classList.add("ie");
document.getElementsByTagName("body")[0].classList.add("ie" + IEversion);
} else {
// document.getElementById('result').innerHTML = 'NOT IE';
}
monitorEvents(document.body); // logs all events on the body
monitorEvents(document.body, 'mouse'); // logs mouse events on the body
monitorEvents(document.body.querySelectorAll('input')); // logs all events on inputs
$('a').on("click mousedown mouseup focus blur keydown change mouseup click dblclick mousemove mouseover mouseout mousewheel keydown keyup keypress textInput touchstart touchmove touchend touchcancel resize scroll zoom focus blur select change submit reset",function(e){
console.log(e);
});
window.location.origin = window.location.origin || window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
@danielt69
danielt69 / user_idle.js
Created July 7, 2016 07:28
How to Detect user is active or idle on web page Using JQuery ? From https://arjunphp.com/detect-user-is-active-or-idle-on-web-page-using-jquery/
$(document).ready(function () {
var idleState = false;
var idleTimer = null;
$('*').bind('mousemove click mouseup mousedown keydown keypress keyup submit change mouseenter scroll resize dblclick', function () {
clearTimeout(idleTimer);
if (idleState === true) {
$("body").css('background-color','#fff');
}
idleState = false;
idleTimer = setTimeout(function () {