Idea: grunt-contrib-imagemin as a Service
- nginx
- luajit
- imagemagick
- OptiPNG, pngquant, jpegtran and gifsicle
import types | |
class decorator(object): | |
""" | |
When using a decorator, the function that is being decorated | |
loses its __name__, docstring, and signature. | |
For example, consider the generic decorator ``my_decorator``: | |
def my_decorator(fn): |
// If URL is available URL link the image | |
// Otherwise just display the image | |
<% if ( instagram_link_url ) { %> <a href="<%= instagram_link_url %>" target="_blank"> <% } %> | |
<img src="<%= url %>" alt="<%= username %>" /> | |
<% if ( instagram_link_url ) { %> </a> <% } %> | |
// Example 2 - Check if formated date | |
<% if (typeof(date) != "undefined") { %> | |
<span class="date"><%= date %></span> | |
<% } %> |
import tornado.ioloop | |
import tornado.web | |
import tornado.escape | |
import tornado.options | |
import tornado.httputil | |
import jinja2 | |
import pyjade.compiler | |
import coffeescript | |
import markdown |
#!/usr/bin/env python | |
# also check https://gist.github.com/fliphess/7836479 | |
import tornado.ioloop | |
import tornado.web | |
import base64 | |
import netaddr | |
import bcrypt | |
def require_basic_auth(handler_class): |
Idea: grunt-contrib-imagemin as a Service
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
from flask import Flask, redirect, url_for | |
from markdown import markdown | |
import os | |
import re | |
# create the app | |
# TODO: load config/template from files, with fallbacks |
function Get-WebFile { | |
param( | |
[Parameter(Mandatory=$true)] | |
$Uri, | |
[string] $OutFile, | |
[string] $Hash, | |
[string] $HashAlgorithm = 'SHA256' | |
) | |
if (-not $OutFile) { |
/* | |
AjaxHook.js - A simple utility library for intercepting Ajax calls. | |
This may be useful to inject simple interceptors to analyze pr capture Ajax traffic and may be even useful for automation tests to determine when an Ajax response returns. | |
To use : | |
1>Create a new AjaxHook object | |
var hook = new AjaxHook(); |
import math | |
def distance(lat1, long1, lat2, long2): | |
R = 6371 # Earth Radius in Km | |
dLat = math.radians(lat2 - lat1) # Convert Degrees 2 Radians | |
dLong = math.radians(long2 - long1) | |
lat1 = math.radians(lat1) | |
lat2 = math.radians(lat2) | |
a = math.sin(dLat/2) * math.sin(dLat/2) + math.sin(dLong/2) * math.sin(dLong/2) * math.cos(lat1) * math.cos(lat2) | |
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a)) |
Web Application Hacker's Handbook Task checklist as a Github-Flavored Markdown file