Skip to content

Instantly share code, notes, and snippets.

View Pushplaybang's full-sized avatar
:octocat:
0_0

Paul Pushplaybang

:octocat:
0_0
View GitHub Profile
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@ingdir
ingdir / gist:0b211b9253c376f9cfa5
Last active December 3, 2023 11:47
BEM Cheatsheet

BEM Cheatsheet

BLOCK

Block encapsulates a standalone entity that is meaningful on its own.

While blocks can be nested and interact with each other, semantically they remain equal; there is no precedence or hierarchy.

Holistic entities without DOM representation (such as controllers or models) can be blocks as well.

@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
<template name="ForgotPassword">
<form action="/forgot" id="forgotPasswordForm" method="post">
<input id="forgotPasswordEmail" type="text" name="email" placeholder="Email Address">
<input class="btn-submit" type="submit" value="Send">
</form>
<!-- end #forgot-password-form -->
</template>
# SYNTAX:
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
# BRACKETS:
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active April 19, 2024 01:50
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@DavidReinberger
DavidReinberger / MeteorOcean.md
Last active December 16, 2020 23:41
Running Meteor.js apps on Digital Ocean with Phusion Passenger and NGNIX

How to setup Meteor.js with Phusion Passenger and ngnix

Introduction

This article will guide you thru running a production ready meteor.js app on Digital Ocean with Phusion Passenger and ngnix.

Quick Summary

  1. Create a droplet
  2. Install Phusion Passanger with NGNIX
  3. Install node.js
  4. Configure NGNIX
@Pushplaybang
Pushplaybang / revealing-module-pattern-template.js
Last active September 8, 2019 21:52
Pattern Template : Revealing Module
var Module = (function(w, $) {
var State = {
initialized : false,
listening : false,
};
var Events = $({});
var Internal = {
/* Throttle Events */
throttle : function(fn, threshhold, scope) {