Skip to content

Instantly share code, notes, and snippets.

View pierrehenri220's full-sized avatar

Peter (ピエール) pierrehenri220

View GitHub Profile
@pierrehenri220
pierrehenri220 / build_openlitespeed_centos.sh
Last active May 15, 2021 15:15
Build OpenLiteSpeed 1.6.21 on CentOS
#!/bin/bash -ev
yum install wget
wget https://openlitespeed.org/packages/openlitespeed-1.6.21.src.tgz
yum install tar
tar -zxvf openlitespeed-1.6.21.src.tgz
cd openlitespeed-1.6.21
./build.sh
./install.sh
@pierrehenri220
pierrehenri220 / cf_tunnels2csv.js
Created April 5, 2020 11:29
ClickFunnels Tunnels to CSV generator
var csv = [];
$( '.sortingGroups .groupForFunnel' ).each(function() {
csv.push( $( this ).find( '.title' ).html() + "\n");
$( this ).find( '.groupFunnels .pageListingItem' ).each(function() {
csv.push( [
$( this ).find( '.pageListingTitle a' ).html(),
$( this ).find( '.pageListingTitle a' ).attr( 'href '),
$( this ).find( '.funnelStatSmall' ).text()
].join( "\t" ) + "\n" );
});
@pierrehenri220
pierrehenri220 / wp_plugins-list_dumper.js
Last active April 5, 2019 08:43
List Wordpress plugins used. Open the plugin page and copy-paste the snippet on your browser developer tools
var html = [];
jQuery( 'tr.active:not(.plugin-update-tr)' ).each(function() {
html.push([
'-'
, jQuery( this ).find( 'td.plugin-title > strong' ).html()
, jQuery( this ).find( '.plugin-version-author-uri' ).text().split( '|' )[ 0 ]
].join(' '));
});
console.log( html.join( "\n" ) );
@pierrehenri220
pierrehenri220 / single.php
Last active March 2, 2018 00:16
Markdown Output
<?php
<div class="entry-content">
echo markdown( get_the_content() );
</div>
<div class="entry-extra">
echo markdown( get_field( 'my_custom_field' ) );
</div>
?>
@pierrehenri220
pierrehenri220 / functions.php
Last active March 2, 2018 00:05
Markdown without using JetPack
require_once get_template_directory() . '/inc/php-markdown-1.8.0/Michelf/Markdown.inc.php';
use MichelfMarkdown;
function markdown( $str ) {
return Markdown::defaultTransform( $str );
}
@pierrehenri220
pierrehenri220 / git_init.sh
Created February 28, 2018 01:37
Initialize a git repository into a non empty directory
git init
git remote add origin git@github.com:USER/REPOSITORY.git
git pull origin master
@pierrehenri220
pierrehenri220 / test-email.php
Created November 19, 2017 06:47
Simple PHP Mail test
<?php
# Source: https://www.conetix.com.au/support/article/simple-php-mail-test
# Howto: ssh login, then php test-email.php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "emailtest@YOURDOMAIN";
$to = "YOUREMAILADDRESS";
$subject = "PHP Mail Test script";
$message = "This is a test to check the PHP Mail functionality";
$headers = "From:" . $from;
@pierrehenri220
pierrehenri220 / facebook-loader.js
Created February 5, 2017 01:31
Facebook likebox loader Part 3 of 3 (JS)
window.fbAsyncInit = function () {
FB.init({xfbml:true});
FB.Event.subscribe('xfbml.render',function(response){
if (!/fb_loaded/.test(document.body.className)) {
document.body.className += " fb_loaded";
}
});
};
@pierrehenri220
pierrehenri220 / facebook-loader.css
Last active February 5, 2017 01:31
Facebook likebox loader Part 2 of 3 (CSS)
#sns_likebox {
background: url(loader.gif) no-repeat 50% 50%;
}
.fb_loaded #sns_likebox {
background: #fff;
}
@pierrehenri220
pierrehenri220 / facebook-loader.html
Last active February 5, 2017 01:28
Facebook likebox loader Part 1 of 3 (HTML)
<div id="sns_likebox">
<div class="fb-like-box" data-href="{url}"
data-width="322" data-height="382"
data-colorscheme="light" data-show-faces="false"
data-header="false" data-stream="true"
data-show-border="true">
</div>
</div>