Skip to content

Instantly share code, notes, and snippets.

openapi: 3.0.0
info:
title: Sample API
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
version: 0.1.9
servers:
- url: http://api.example.com/v1
description: Optional server description, e.g. Main (production) server
- url: http://staging-api.example.com
description: Optional server description, e.g. Internal staging server for testing
@Nilegfx
Nilegfx / simple2.md
Last active February 22, 2021 15:22

new javascript interview challenges.

Challange 0: Tell the truth Write a function that returns the number of truthy values in a given array. Return 0 if given an empty array.
// Examples
countTruthy([true, false, false, true, false]) // ➞ 2
@Nilegfx
Nilegfx / simple.md
Last active September 26, 2020 13:43

javascript interview challenges

Challange 1: Tell the truth

Write a function that returns the number of truthy values in a given array. Return 0 if given an empty array.

// Examples
apiVersion: apps/v1
kind: Deployment
metadata:
name: 'manual-test-namespaced'
namespace: 'nile2'
labels:
app: 'manual-test-namespaced'
spec:
replicas: 2
selector:
version: '3.5'
services:
es5:
container_name: es5
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.10
environment:
xpack.security.enabled: "false"
ES_JAVA_OPTS: '-Xms512m -Xmx512m'
ports:
- 9200:9200
@Nilegfx
Nilegfx / gist:959c78dfe06a87ae88aafb7771e9f390
Created November 16, 2017 09:11 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
[{
"id": 1,
"first": "Conney",
"last": "Woodall",
"gender": "Male",
"level": 4301
}, {
"id": 2,
"first": "Ingeborg",
"last": "Cuthill",
@Nilegfx
Nilegfx / json
Last active July 22, 2017 19:45
[{
"id": 1,
"first_name": "Taber",
"last_name": "Atlay",
"gender": "Male",
"value": 8326
}, {
"id": 2,
"first_name": "Grace",
"last_name": "Petow",
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js"></script>
@Nilegfx
Nilegfx / ancestors.js
Created April 2, 2016 08:18 — forked from h2non/ancestors.js
Recursively inspect the prototype chain inheritance of a given object in JavaScript (inspired in Ruby's Class.ancestors)
// Under WTFPL license ;)
function ancestors(obj) {
var hierarchy = [];
if (['boolean', 'number', 'string', 'undefined'].indexOf(typeof obj) !== -1 || obj === null) { // primitives types
obj = Object(obj);
} else if (typeof obj === 'function') {
hierarchy.push(
obj.name ||
(obj.toString().match(/function (\w*)/) ||
obj.toString().match(/\[object (\w*)\]/))[1] ||