Skip to content

Instantly share code, notes, and snippets.

View kingsloi's full-sized avatar

Kingsley Raspe kingsloi

View GitHub Profile
@kingsloi
kingsloi / .jshintrc
Created May 5, 2016 19:13
JsFormat.sublime-settings
{
/*
* ENVIRONMENTS
* =================
*/
"globals": {
"localStorage": false,
"document": false,
"confirm" :false,
@kingsloi
kingsloi / gulpfile.js
Created April 30, 2015 18:19
Laravel Elixir/Gulp
var elixir = require('laravel-elixir');
require('laravel-elixir-browsersync');
// PARAMS - is --production?
var inProduction = elixir.config.production;
// PATHS - Bower
var bower_path = "./resources/assets/bower";
#!/bin/sh -x
# ==================================
# iptables default configuration script
#
# - this locks down our servers port access
# ==================================
# install fail2ban
sudo apt-get update
@kingsloi
kingsloi / Blog.php
Last active August 29, 2015 14:16
Mangeto 1.9 CE - aheadWorks Blog - Assign a Featured Product to a Blog post that appears in the sidebar
<?php
// add this to
// app/code/community/AW/Blog/Model/Blog.php
public function getFeaturedProductId()
{
$content = $this->getData('featured_product_id');
return $content;
}
@kingsloi
kingsloi / redactor(strip-tags-function-only).js
Last active August 29, 2015 14:15
Fix: Mangeto 1.9 CE - Redactor WYSIWYG Extention - Rejecting Paste from Microsoft Word
// REMOVE TAGS
stripTags: function(html)
{
// Redactor WYSIWYG editor refusing to accept pasted content from MS Word
// By Kingsley Raspe
// See: https://gist.github.com/kingsloi/97260c320bf22e5b96c7
var allowedObj = this.opts.allowedTags;
var allowed = '';
@kingsloi
kingsloi / generate-select-for-bootstrap-tabs.js
Last active March 25, 2018 04:59
Generate <select> drop down boxes for Twitter Bootstrap tabs (.nav-tabs) - jsfiddle: http://jsfiddle.net/kingsloi/96ur6epu/
$(document).ready(function(){
//set the index counter
var i = 0;
//convert all .nav-tabs, except those with the class .keep-tabs
$('.nav-tabs').not( ".keep-tabs" ).each(function(){
//init variables
var $select,