- Rails: https://github.com/rails/pjax_rails
- Django: https://github.com/jacobian/django-pjax
- Asp.Net MVC3: http://biasecurities.com/blog/2011/using-pjax-with-asp-net-mvc3/
- FuelPHP: https://github.com/rcrowe/fuel-pjax
- Grails: http://www.bobbywarner.com/2012/04/23/add-some-pjax-to-grails/
- Express: https://github.com/abdelsaid/express-pjax-demo
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
SILENT = ENV['SL_SILENT'] =~ /false/i ? false : true || true | |
VERSION = '2.2.23' | |
# SearchLink by Brett Terpstra 2015 <http://brettterpstra.com/projects/searchlink/> | |
# MIT License, please maintain attribution | |
require 'net/https' | |
require 'uri' |
// https://github.com/EightMedia/hammer.js/blob/master/hammer.js | |
function toId(t) { | |
return t.toLowerCase().replace(/[^a-z]/gi, "-").replace(/-+/gi, "-") | |
} | |
function toc() { | |
var t = $("#sidebar").html(""); | |
$("h1,h2,h3").each(function() { | |
var e = $(this).clone(), n = $(this).offset().top; | |
"#" != e.html() && (e.is("h3") && e.html("‐ " + e.html()), t.append(e), e.on("click", function() { | |
$("body").animate({scrollTop: n}, 200) |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
// add the filter to your application module | |
angular.module('myApp', ['filters']); | |
/** | |
* Filesize Filter | |
* @Param length, default is 0 | |
* @return string | |
*/ | |
angular.module('filters', []) | |
.filter('Filesize', function () { |
<!DOCTYPE html> | |
<html lang="fr"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="author" content="Miguel O."> | |
<meta name="description" content="A simple web notepad"> | |
<title>Custom Editor</title> | |
<link rel="shortcut icon" href="http://elmike.net/favicon.ico"/> | |
<style type="text/css"> |
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
https://github.com/djvirgen/virgen-acl Simple and elegant, create your own checks. No middleware?
https://github.com/OptimalBits/node_acl Use as middleware, create your own roles and access. Great choice.
https://github.com/tschaub/authorized Similar to connect roles... but a bit more robust? you can create roles and action, and associate many roles with that action
var feathers = require('feathers'); | |
var bodyParser = require('body-parser'); | |
// An in-memory service implementation | |
var memory = require('feathers-memory'); | |
// Create an in-memory CRUD service for our Todos | |
var todoService = memory(); | |
var app = feathers() | |
// Set up REST and SocketIO APIs | |
.configure(feathers.rest()) |