Skip to content

Instantly share code, notes, and snippets.

View KINKCreative's full-sized avatar

Klemen KINKCreative

  • Los Angeles, CA
View GitHub Profile
@KINKCreative
KINKCreative / gist:2987fc806dea66d44a44
Last active August 29, 2015 14:01
Switch MySQL tables to INNODB
SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=InnoDB;') AS sql_statements
FROM information_schema.tables AS tb
WHERE table_schema = 'database_name'
AND `ENGINE` = 'InnoDB'
AND `TABLE_TYPE` = 'BASE TABLE'
ORDER BY table_name DESC;
@KINKCreative
KINKCreative / gist:5b0a2ce4f803dd1e99b5
Created May 7, 2014 07:41
Update WordPress home url
#run mysql daemon
#select database you're using
#note wp_prefix can be something else too
update wp_options set option_value='http://newurl.com' where option_name='home' or option_name = 'siteurl';
@KINKCreative
KINKCreative / gist:9d87785edcb6a292a5a7
Created May 28, 2014 00:35
Silverstripe 2.4. Rewrite with IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="SilverStripe Clean URLs" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
# Install fail2ban
$ sudo apt-get install fail2ban
#### /etc/fail2ban/jail.local
[apache]
enabled = true
@KINKCreative
KINKCreative / gist:64dd920258bad2e03c74
Created October 1, 2014 06:57
Brightcove AutoPlay and Muted player
<!-- Start of Brightcove Player -->
<div style="display:none"></div>
<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C
found at https://accounts.brightcove.com/en/terms-and-conditions/.
-->
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<script src="http://admin.brightcove.com/js/APIModules_all.js"> </script>
@KINKCreative
KINKCreative / gist:1edd14a43e16a34eeb34
Created October 7, 2014 02:25
PHPMailer() SMTP with Gmail
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.gmail.com";
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->Username = "xxxxxxx@gmail.com";
@KINKCreative
KINKCreative / gist:535c6cfabcf71a3ae6ef
Created October 10, 2014 16:49
MailChimp PHP Registration
<?php
namespace Drewm;
/**
* Super-simple, minimum abstraction MailChimp API v2 wrapper
*
* Uses curl if available, falls back to file_get_contents and HTTP stream.
* This probably has more comments than code.
*
@KINKCreative
KINKCreative / gist:37c9a9006e0b1a8d0eb4
Created October 21, 2014 21:53
Chiquis - Custom one video Custom Html code
<!-- ENGLISH FEATURED VIDEOS HERE -->
<div class="large-4 columns">
<h3>I'm Not That Girl <br/>(Official Music Video)</h3>
<p> Watch Chiquis' Hit Single<br/><strong>I'm Not That Girl</strong> on<br/>
<img src="http://38.media.tumblr.com/e128ea2982fdb6df9cd44d486347ceb9/tumblr_mog0viDv891svlv8bo2_1280.png" style="max-height:40px !important;" /></p>
<div class="addthis_wrapper">
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url="https://www.youtube.com/watch?v=0tr9mYglHiU" addthis:title="Chiquis - I'm Not That Girl (Official English Video)">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
@KINKCreative
KINKCreative / gist:df68342889c5740a5b2b
Created October 31, 2014 17:05
EstrellaTV Videos Custom Embed with Share
<div style="display:none"></div>
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience3857591643001" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="**WIDTH**" />
<param name="height" value="**HEIGHT**" />
<param name="playerID" value="2591610883001" />
<param name="playerKey" value="AQ~~,AAACW2gH-yk~,LTOMIBNGiaYQoerc4mG5nWxubZlMSV1K" />
<param name="isVid" value="true" />
@KINKCreative
KINKCreative / gist:b5186e1532dc2f2d4f95
Created February 12, 2015 01:22
WP Mailchimp form for use with Bootstrap
<p>
<input type="email" id="mc4wp_email" class="form-control" name="EMAIL" placeholder="Your email address" required />
</p>
<p>
<input type="submit" class="btn btn-primary" value="Sign up" />
</p>