Skip to content

Instantly share code, notes, and snippets.

View contactjavas's full-sized avatar
🎯
Focusing on MapSteps

Bagus contactjavas

🎯
Focusing on MapSteps
View GitHub Profile
@odan
odan / Slim 4 Tutorial.md
Last active January 15, 2022 11:22
Slim 4 Tutorial
@mihdan
mihdan / is_gutenberg_active.php
Created November 11, 2018 19:34 — forked from kagg-design/is_gutenberg_active.php
Function to check if Gutenberg is active.
/**
* Check if Gutenberg is active.
* Must be used not earlier than plugins_loaded action fired.
*
* @return bool
*/
private function is_gutenberg_active() {
$gutenberg = false;
$block_editor = false;
@kharakhordindemo
kharakhordindemo / form.php
Created December 22, 2017 15:21
Remove span in Contact Form 7
/*Contact form 7 remove span*/
add_filter('wpcf7_form_elements', function($content) {
$content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content);
$content = str_replace('<br />', '', $content);
return $content;
});
@ediamin
ediamin / wpautop.js
Created February 27, 2017 09:49
JavaScript version of WordPress wpautop function
// source: https://github.com/andymantell/node-wpautop
function _autop_newline_preservation_helper (matches) {
return matches[0].replace( "\n", "<WPPreserveNewline />" );
},
function wpautop(pee, br) {
if(typeof(br) === 'undefined') {
br = true;
}
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@jaredjburgess
jaredjburgess / vex.dialog.buttons.js
Created March 3, 2016 15:58
Vex buttons for a confirm dialog.
buttons: [
$.extend({}, vex.dialog.buttons.YES, {
text: 'Yes'
}), $.extend({}, vex.dialog.buttons.NO, {
text: 'Cancel'
})
]
@gsherwood
gsherwood / ruleset.xml
Created December 5, 2014 20:06
PSR2 with tabs instead of spaces
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>PSR2 with tabs instead of spaces.</description>
<arg name="tab-width" value="4"/>
<rule ref="PSR2">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
@zach-klippenstein
zach-klippenstein / ChangePassword.java
Last active April 3, 2024 18:04
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall (rsdio@metastatic.org), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{