Skip to content

Instantly share code, notes, and snippets.

<?php
echo "nice";
@pentatonicfunk
pentatonicfunk / sample.php
Created January 25, 2018 18:45
PHP API/Scraper Sample
<?php
namespace App\Hapenesia\GsmArena;
use App\Color;
use App\Spec;
use Carbon\Carbon;
use GuzzleHttp\Client;
use GuzzleHttp\Cookie\FileCookieJar;
use GuzzleHttp\Handler\CurlHandler;
@pentatonicfunk
pentatonicfunk / leadgen_form
Created March 9, 2018 21:08
LGF Shortcode Function
// SHORTCODE
function leadgen_form( $atts ) {
extract( shortcode_atts( array(
'styles' => true,
'name' => 'Name',
'phone' => 'Phone',
'email' => 'Email',
'budget' => 'Desired Budget',
'message' => 'Message',
location / {
# Nginx doesn't support nested If statements, so we
# concatenate compound conditions on the $cors variable
# and process later
# If request comes from allowed subdomain
# (*.mckinsey.com) then we enable CORS
if ($http_origin ~* (http?://.*\.DOMAIN_FRONT_END\.co\.id(:[0-9]+)?$)) {
set $cors "1";
}
--- ext/dom/node.c 2012-08-06 17:49:48.826716692 +0800
+++ ext/dom/node.c 2012-08-06 17:52:47.633484660 +0800
@@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNA
RETVAL_FALSE;
} else {
if (mode == 0) {
+#ifdef LIBXML2_NEW_BUFFER
+ ret = xmlOutputBufferGetSize(buf);
+#else
ret = buf->buffer->use;
<h3>CONNECTED</h3>
<?php foreach( $this->addons_list_grouped_by_connected['connected'] as $key => $provider ) { ?>
<tr>
<td><?php echo esc_html( $provider['short_title'] ); ?>
<?php
if ( $provider['is_pro'] === "1" ) {
?>
<a role="button" class="sui-button sui-button-upsell sui-tooltip sui-tooltip-top-left" type="button" data-tooltip="<?php esc_html_e( "Unlock this as part of a WPMU DEV Membership", Forminator::DOMAIN ); ?>" href="" rel="dialog"><?php esc_html_e( "Pro Feature", Forminator::DOMAIN ); ?></a>
@pentatonicfunk
pentatonicfunk / exec.sh
Last active April 25, 2018 04:38
Install Dialog and Locales for Ubuntu on WSL LXRunOffline
apt install dialog
apt install locales
locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales
@pentatonicfunk
pentatonicfunk / kill-cache.conf
Created April 25, 2018 04:42
Force Kill Nginx Cache
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
# don't cache it
proxy_no_cache 1;
# even if cached, don't try to use it
@pentatonicfunk
pentatonicfunk / http-default.conf
Created April 25, 2018 04:46
Http Default Nginx config
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_names_hash_max_size 1024;
include /etc/nginx/mime.types;
default_type application/octet-stream;
types {
# Data interchange
application/atom+xml atom;
application/json json map topojson;
application/ld+json jsonld;
application/rss+xml rss;
application/vnd.geo+json geojson;
application/xml rdf xml;