Skip to content

Instantly share code, notes, and snippets.

@yhaskell
yhaskell / KCC.cs
Last active September 20, 2015 08:25
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NotifyExample
{
class KCC
#%RAML 0.8
title: New API
version: v1
baseUri: http://api.samplehost.com
resourceTypes:
- base :
get?:
queryParameters:
username:
#%RAML 1.0
title: WebOfMe
version: v1-change#3
mediaType: application/json
resourceTypes:
collection:
get:
queryParameters:
page:
description: Starting page
@yhaskell
yhaskell / a.ts
Last active September 25, 2015 13:47
function genStructuredValue(name: string, parent: hl.IHighLevelNode, pr: hl.IProperty) : string | hlimpl.StructuredValue {
if (pr.range() instanceof defs.ReferenceType){
var t=<defs.ReferenceType>pr.range();
var mockNode=jsyaml.createNode(name);
return new hlimpl.StructuredValue(mockNode, parent, pr);
// var hn = stv.toHighlevel()
// return hn;
@yhaskell
yhaskell / a.rb
Created September 28, 2015 18:00
/classes:
/{className}:
type: { parseMember: { schema: installationGet } }
description: Collection of class instances
get:
description: |
Retreives objects. The response body is a JSON object containing all the user-provided fields,
plus the createdAt, updatedAt, and objectId fields.
body:
application/x-www-form-urlencoded:
#%RAML 0.8
title: GeoNames
baseUri: http://api.geonames.org
schemas:
- postal-codes-xml: !include schemas/postal-codes-xml-schema.xsd
- astergdem-xml: !include schemas/astergdem-xml-schema.xsd
- astergdem: !include schemas/astergdem-schema.json
- records-xml: !include schemas/records-xml-schema.xsd
- neighbourhood-xml: !include schemas/neighbourhood-xml-schema.xsd
- features-xml: !include schemas/features-xml-schema.xsd
@yhaskell
yhaskell / begin.raml
Last active September 28, 2015 19:58
#%RAML 0.8
title: New API
version: v1
baseUri: http://api.samplehost.com
/helloWorld:
get:
protocols:
- HTTP
- HTTPS
responses:
#%RAML 0.8
title: New API
version: v1
baseUri: http://api.samplehost.com
/helloWorld:
get:
responses:
200:
body:
application/json:
#%RAML 0.8
title: New API
version: v1
baseUri: http://api.samplehost.com
/helloWorld:
get:
responses:
200:
body:
application/json:
@yhaskell
yhaskell / code.c
Last active October 7, 2015 16:05
int main () {
int value = 18361; // присвоит в value 18361
int outsys = 6; // присвоит в outsys 6
while (value > 0) { // пока value > 0, условие вычислится в true. заходим
printf ("%d", value % outsys); // выведет value % outsys == 18361 % 6 == 1, 0, 0, 1, 2, 2
value = (value / outsys); // запишет в value 3060, 510, 85, 14, 2, 0
}
return 0; // выйдет
}