Skip to content

Instantly share code, notes, and snippets.

View zdne's full-sized avatar
💭
🚀

Z zdne

💭
🚀
View GitHub Profile
@betamax
betamax / apib2httpsnippets
Created June 19, 2015 12:27
A ruby script to convert an HTTP blueprint JSON file into multiple HAR files and then convert those HAR files in to code snippets using httpsnippet
#!/usr/bin/env ruby
# ./apib2httpsnippets
# Author: Max Novakovic
# Email: [email protected]
require 'awesome_print'
require 'json'
require 'fileutils'
require 'uri'
@adamhurst
adamhurst / index.html
Last active April 24, 2023 15:20
3D DNA Helix
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script type="text/javascript">
@kevinswiber
kevinswiber / heartbeat.js
Last active June 5, 2016 08:34
Zetta devices with documentation.
var util = require('util');
var Device = require('zetta').Device;
/// # heartbeat
///
/// A mock heartbeat sensor, often used as a driver example
/// for exposing streams.
///
/// This device has the following properties:
/// * `pulse`
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active May 2, 2025 15:13
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@bpedro
bpedro / postman2apiblueprint
Created March 10, 2015 19:49
Generates API Blueprint documentation from a POSTMAN Collection JSON file.
#!/usr/bin/env node
var fs = require('fs')
, url = require('url');
if (process.argv.length < 3) {
console.log('Usage:\n', process.argv[1] + ' <postman collection JSON file>\n\n');
process.exit();
}
# i18n Group
The i18n api mock.
## The translation API [/i18n/{id}{?locale}]
+ Parameters
+ locale (required, string, `de_DE`)
+ id (required, int, 1)
@koistya
koistya / DefaultLayout.jsx
Last active July 1, 2021 16:05
React.js (ReactJS) Page and Layout components. For a complete sample visit https://github.com/kriasoft/react-starter-kit and http://reactjs.kriasoft.com (demo)
/**
* Page layout, reused across multiple Page components
* @jsx React.DOM
*/
var React = require('react');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var Navigation = require('../components/Navigation.jsx');
var DefaultLayout = React.createClass({
@jm3
jm3 / 7 Questions All Businesses Must Answer.md
Last active September 29, 2023 22:12
from Peter Thiel's book, Zero to One
pt Seven Questions All Businesses Must Answer
  1. The Engineering Question: Can you create breakthrough technology (vs. incremental improvement)?

  2. The Timing Question: Is now the right time to start this particular business?

  3. The Monopoly Question: Are you starting with a big share of a small market?

@ttahmouch
ttahmouch / rest-client-example
Created August 20, 2014 04:10
Compare RESTful API Client with RESTless API Client
<!DOCTYPE html>
<html>
<head>
<title>Coast Browser</title>
</head>
<body>
<script src="http://127.0.0.1:8080/ua"></script>
<script>
/**
* @param window represents a window containing a DOM document.
@ttahmouch
ttahmouch / uri.js
Last active August 29, 2015 14:04
RFC 3986 URI En/Decoding in Javascript (Node and Browser)
/**
* A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical
* resource.
* @example "http://www.google.com:80/search?query=text#result"
*
* @return {Uri}
* @constructor
*/
function Uri() {
return this;