- Without ID will create a new item in a collection, and return that new item
- Without ID, with reference_id in payload will create a new item in a collection with the same attributes as the item with a matching id as the reference_id (and use any other attributes in payload as overrides), and return that new item (cloning)
- With an ID will return error code 405
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# COM-port settings | |
# Add this string | |
# KERNEL=="ttyUSB[0-9]", RUN+="/bin/stty -F /dev/%k speed 9600 -brkint -icrnl ixoff -imaxbel -opost -onlcr -isig -icanon -echo -echoe" | |
# in /etc/udev/rules.d/50-udev.rules | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# GUAFAL | |
# Gather User-Agents From Access Log | |
WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [ "$1" == "" ]; then | |
echo "Sorry, i need an access_log path." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Formats a JSON string for pretty printing | |
* | |
* @param string $json The JSON to make pretty | |
* @param bool $html Insert nonbreaking spaces and <br />s for tabs and linebreaks | |
* @return string The prettified output | |
* @author Jay Roberts | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# DNS Result Comparison Utility | |
# Author: https://twitter.com/chair6 | |
# | |
import argparse | |
import dns.resolver | |
import dns.rdatatype | |
from collections import defaultdict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trim(c) { | |
var ctx = c.getContext('2d'), | |
copy = document.createElement('canvas').getContext('2d'), | |
pixels = ctx.getImageData(0, 0, c.width, c.height), | |
l = pixels.data.length, | |
i, | |
bound = { | |
top: null, | |
left: null, | |
right: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u.ease = { | |
quadratic: { | |
style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', | |
fn: function (k) { | |
return k * ( 2 - k ); | |
} | |
}, | |
circular: { | |
style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', // Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1) | |
fn: function (k) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) { | |
var distance = current - start, | |
speed = Math.abs(distance) / time, | |
destination, | |
duration; | |
deceleration = deceleration === undefined ? 0.0006 : deceleration; | |
destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 ); | |
duration = speed / deceleration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.b-scroller { | |
position:absolute; | |
z-index: 200; | |
width: 100%; | |
height: 100%; | |
padding:0; | |
overflow: hidden; | |
background: none; | |
-webkit-tap-highlight-color: rgba(0,0,0,0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global Scroller: true */ | |
/*global utils: true */ | |
/*global Touch: true */ | |
(function(window, document, Math, Zepto) | |
{ | |
"use strict"; | |
var defaults = | |
{ |
OlderNewer