Skip to content

Instantly share code, notes, and snippets.

View custom-menu-items.php
<?php
/*
* Note! This is no longer updated here in the Gist. It has been moved to a repo.
*
* @link https://github.com/daggerhart/wp-custom-menu-items
*/
/**
* Class custom_menu_items
View Slack.js
var Slack = require('slack-client');
exports.foobar = function foobar() {
var token = '';
var autoReconnect = true;
var autoMark = true;
var slack = new Slack(token, autoReconnect, autoMark);
View LoginController.js
// controllers/LoginController.js
module.exports = {
index: function(req, res) {
var email = req.param('email');
var password = req.param('password');
// delay everthing to prevent bruteforce, dos and timing attacks
setTimeout(function() {
@braidn
braidn / index.html
Created Sep 18, 2014 — forked from anonymous/index.html
Angular Simple Todo App
View index.html
<!DOCTYPE html>
<html ng-app='todoApp'>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<title>TO DO List</title>
</head>
@tw2113
tw2113 / class.WDS_JetPack_Popular_Posts.php
Last active Apr 14, 2021
JetPack Popular Posts class.
View class.WDS_JetPack_Popular_Posts.php
@staltz
staltz / introrx.md
Last active Apr 18, 2021
The introduction to Reactive Programming you've been missing
View introrx.md
@johnpeele
johnpeele / gulpfile.js
Last active Aug 29, 2015
Gulp for Front-End Development
View gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var styl = require('gulp-styl');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
View sails-overriding-bodyParser.md
@adityamukho
adityamukho / User.js
Last active Mar 7, 2019
Passport authentication for Sails.js 0.9.x
View User.js
/**
* api/models/User.js
*
* The user model contains the instance method for validating the password.
*/
var bcrypt = require('bcrypt');
function hashPassword(values, next) {
bcrypt.hash(values.password, 10, function(err, hash) {
@RunnerRick
RunnerRick / .sails-and-passport.md
Last active Feb 18, 2021 — forked from theangryangel/AuthController.js
How To Integrate Sails and Passport
View .sails-and-passport.md