Skip to content

Instantly share code, notes, and snippets.

View gerzhan's full-sized avatar

Nikolay Gerzhan gerzhan

View GitHub Profile
@gerzhan
gerzhan / gist:5192a4991d546bbd2e48
Last active August 29, 2015 14:25 — forked from fernandojunior/gist:5166fc6f92354cc950c9
A modified Parse.FacebookUtils to use with the modified openFB
/**
* Based on Parse.FacebookUtils. A provider for use the modified openFB in Parse.
* @author Fernando Felix do Nascimento Junior*
**/
(function(root) {
root.Parse = root.Parse || {};
var Parse = root.Parse;
var _ = Parse._;
var PUBLIC_KEY = "*";
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
<!-- Allow web app to be run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable"
content="yes">
<!-- Make the app title different than the page title. -->
@-moz-document url-prefix("https://web.skype.com/en/")
{
.swx.themeBlue,
.swx .themeBlue,
.swx .themeWhite.side .recent.active
{
background-color: #cccccc !important;
fill: #00aff0 !important;
color: #ffffff !important;
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',

Body Parsers Through the Ages

An overview of how body parsers and file uploads work in general, and why Skipper is designed the way it is.

This is a work-in-progress based on discussion here https://github.com/balderdashy/skipper/issues/54#issuecomment-72048398

How File Uploads Work

This is my first attempt at explaining the efficient handling of TB multipart file uploads using ASCII infographics, so please be patient :p

#!/usr/bin/env node
/**
* Module dependencies
*/
var Async = require('async');
var Filesystem = require('machinepack-fs');
var Prompts = require('machinepack-prompts');
var Sails = require('sails').Sails;
// 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() {
// 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() {
@gerzhan
gerzhan / 0.README.md
Last active August 29, 2015 14:21 — forked from airtonix/0.README.md

Intro

session-less use of jwt and passport.js

note: by module I mean either a javascript (.js) or coffeescript (.coffee) file

installation

install the following:

  • sailsjs
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);