Skip to content

Instantly share code, notes, and snippets.

View zdne's full-sized avatar
💭
🚀

Z zdne

💭
🚀
View GitHub Profile
@zdne
zdne / BasicExample.md
Last active December 13, 2015 21:28
Deprecated. This is an example file for the upcoming Apiary.io blog post on New API Blueprint Format.

Format: 1A Host: http://blog.acme.com

Basic ACME Blog API

NOTE: This document is outdated. Refer to the actual API Blueprint examples.

Welcome to the ACME Blog API. This API provides access to the ACME Blog service.

@zdne
zdne / something.md
Created July 31, 2013 14:40
cURL trace parser output

POST /shopping-cart

  • Request
    • Headers

        User-Agent:curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
        Host:curltraceparser.apiary.io
        Accept:*/*
        Content-Type:application/json
        Content-Length:39
      
@zdne
zdne / mutlipart-example
Last active March 25, 2021 03:44
API Blueprint multipart request example. Raw HTTP source: http://chxo.com/be2/20050724_93bf.html.
# POST /path/to/script.php
+ Request (multipart/form-data, boundary=AaB03x)
+ Headers
Content-Length: $requestlen
+ Body
@zdne
zdne / collection-api.raw.txt
Last active December 21, 2015 10:28
API Blueprint collection example – http://apiblueprint.org
# Collection API
# Group Coupons
Group of all coupon-related resources.
## Coupon [/coupons/{id}]
A resource representing one coupon.
+ Coupon Object (application/json)
@zdne
zdne / vnd.apiblueprint.ast+json.json
Last active December 21, 2015 10:38
Testing new API Blueprint parameters syntax

Full-featured

NOTE: Colons are optional. Keywords are case insensitive.

  • Parameters

    • id

      Lorem ipsum dolor sit amet, consectetur adipiscing elit. In molestie justo eget diam vulputate rutrum. Donec ultrices est sed scelerisque lacinia.

@zdne
zdne / gist:6366103
Created August 28, 2013 13:31
Install GCC 4.7 on Ubuntu Precise
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-4.7 g++-4.7
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
$ sudo update-alternatives --config gcc
@zdne
zdne / install.sh
Last active January 20, 2023 15:43
Install phantomjs 1.9.1 x64 on Ubuntu Precise
$ sudo apt-get install libfontconfig
$ cd /usr/local/share
$ sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
$ sudo tar xjf phantomjs-1.9.1-linux-x86_64.tar.bz2
$ sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
$ sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
$ sudo ln -s /usr/local/share/phantomjs-1.9.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
@zdne
zdne / gist:6560278
Created September 14, 2013 08:58
Example API Blueprint parser output in the JSON format
{
"_version": "1.0",
"metadata": {},
"name": "",
"description": "",
"resourceGroups": [
{
"name": "",
"description": "",
"resources": [
@zdne
zdne / gist:7361466
Created November 7, 2013 20:38
This is the full listing to http://docs.urlencoded.apiary.io
@zdne
zdne / Google Chrome Incognito.applescript
Last active January 31, 2023 19:38
Google Chrome Incognito – AppleScript to always run chrome in incognito mode. Save as an application to your Application folder. Optionally drag a and drop Google Chrome Icon in between Get Info panes (⌘+I)
if application "Google Chrome" is running then
tell application "Google Chrome" to make new window with properties {mode:"incognito"}
else
do shell script "open -a /Applications/Google\\ Chrome.app --args --incognito"
end if
tell application "Google Chrome" to activate