Skip to content

Instantly share code, notes, and snippets.

View Vheissu's full-sized avatar
💭
SURFING THE INTERNET

Dwayne Charrington Vheissu

💭
SURFING THE INTERNET
View GitHub Profile
@Vheissu
Vheissu / .htaccess
Last active December 14, 2015 00:39 — forked from geemoney/.htaccess
# BEGIN W3TC Browser Cache
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
@Vheissu
Vheissu / functions.php
Created February 21, 2013 01:42
A function that allows you to query pages by their page_template in Wordpress.
<?php
function get_page_by_template($template_name, $single_key = FALSE, $return = true) {
$args = array(
'post_type' => 'page',
'meta_query' => array(
array(
'key' => '_wp_page_template',
'value' => $template_name
)
@Vheissu
Vheissu / default.rules.php
Created July 6, 2013 13:51
Custom post type support for the WPMU Dev Membership plugin
class M_Recipes extends M_Rule {
var $name = 'recipes';
var $label = 'Recipes';
var $description = 'Allows specific recipes to be protected.';
var $rulearea = 'public';
function admin_main($data) {
if(!$data) $data = array();
@Vheissu
Vheissu / instant-flat-ui.js
Last active December 27, 2015 17:59 — forked from adamschwartz/instant-flat-ui.js
Use documentFragment instead of directly appending element
var f = document.createDocumentFragment();
var d = document.createElement('div');
d.innerHTML = '\
<style>\
*:not(.icon):not(i), *:not(.icon):not(i):after, *:not(.icon):not(i):before {\
box-shadow: none !important;\
text-shadow: none !important;\
background-image: none !important;\
}\
*:not(.icon):not(i) {\
<?php
class RoleTableSeeder extends Seeder {
public function run()
{
// Delete any content in the roles table
DB::table('roles')->delete();
$role_data = array(
<?php
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
@Vheissu
Vheissu / sublime-text-shortcuts.md
Created September 4, 2014 23:08
A compilation of useful shortcuts for Sublime Text

Keyboard shortcuts for Sublime Text Editor

I am using version 2, but these shortcuts will work in Sublime Text editor 3 as well.

Editing & Workflow


  • cmd + t: Go to a file
  • cmd + shift + p: Command popup (this is where you install packages, run other commands and interact with some plugins)
  • cmd + g: Go to a particular line
  • control + ` (tilde): Open up the Python command line
@Vheissu
Vheissu / compiler.ts
Last active August 30, 2015 11:25 — forked from charlespockert/compiler.ts
Kendo grid with Aurelia
import {inject, ViewCompiler, ViewResources, Container} from 'aurelia-framework';
/**
* Compiler service
*
* compiles an HTML element with aurelia
*/
@inject(ViewCompiler, ViewResources, Container)
export class Compiler {
@Vheissu
Vheissu / PascalCaseToFileCase.js
Last active September 3, 2015 10:34
Converting a Javascript constructor name in PascalCase to file-case. Can be used with ES2015 (formerly ES6) classes to get the actual file name.
// ES2015 classes
class MyClass {
// Would return: my-class
toFileCase() {
var className = this.constructor.name.toString();
var normalised = className.replace(/((?!^)[A-Z])/g, '-$1').toLowerCase();
return normalised;
}
}
@Vheissu
Vheissu / app.html
Last active April 28, 2016 00:04 — forked from haiau79/app.html
Navigate Route
<template>
</template>