Skip to content

Instantly share code, notes, and snippets.

View odykyi's full-sized avatar
🍍
(async () => { /* ...loading */ })();

odykyi

🍍
(async () => { /* ...loading */ })();
View GitHub Profile
@odykyi
odykyi / isRequired.js
Last active May 7, 2017 14:48
isRequired.js
const isRequired = () => { throw new Error('param is required'); };
const hello = (name = isRequired()) => { console.log(`hello ${name}`) }
@odykyi
odykyi / index.js
Created September 19, 2017 10:12
index.js
},
function lala() {
console.log('blabla')
@odykyi
odykyi / lodash-js-pagination-page-skip-sort-order-limit.js
Created September 26, 2017 08:59
lodash-js-pagination-page-skip-sort-order-limit.js
/* PAGINATION WITH SORTING AND PAGING */
const page = 1; // input page, min value 1
const limit = 2; // input limit min value 1
/* INPUT ARRAY */
const array = [
{ Editable: true, Name: "Daniel Test", Site: "SE100"},
{ Editable: true, Name: "Test new", Site: "SE100"},
{ Editable: false, Name: "Test", Site: "SE100"},
];
@odykyi
odykyi / a.js
Created September 26, 2017 14:53
a.js
const promise = require('bluebird'); // or any other Promise/A+ compatible library;
const options = {
promiseLib: promise // overriding the default (ES6 Promise);
};
const pgp = require('pg-promise')(options);
const cn = {
host: 'localhost', // 'localhost' is the default;
@odykyi
odykyi / SignInWithTwitter.js
Created October 5, 2017 14:10 — forked from rhussmann/SignInWithTwitter.js
Simple 'sign in with Twitter' implementation in node.js
var http = require('http'),
sys = require('sys'),
URL = require('url'),
querystring = require('querystring'),
OAuth = require('oauth').OAuth;
var oa = new OAuth('https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
'YOUR APP CONSUMER KEY HERE',
'YOUR APP CONSUMER SECRET HERE',
@odykyi
odykyi / .eslintrc
Created December 1, 2017 14:42 — forked from radiovisual/.eslintrc
React Native AirBnB ESLint Config
{
"parser": "babel-eslint",
"plugins": [
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
@odykyi
odykyi / git remote set url.sh
Last active February 23, 2018 09:54
git remote set url.sh
git remote set url.sh
0. git remote -v
1.1 git remote add origin [email protected]:USERNAME/REPOSITORY.git
1.2 git remote add origin https://github.com/USERNAME/REPOSITORY.git
2.1 git remote set-url origin [email protected]:USERNAME/REPOSITORY.git
2.2 git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
@odykyi
odykyi / GraphQL vs Firebase.MD
Created January 5, 2018 16:14
GraphQL vs Firebase.MD

GraphQL vs Firebase

With the variety of server-side technologies today, developers have a lot of choices when it comes to deciding what kind of backend to use for their next application.

In this article, we want to explore the differences between GraphQL and Firebase, two very popular server-side technologies.

Overview

Before diving into technical details, let's create some perspective on the two technologies and where they're coming from.

@odykyi
odykyi / GraphQL vs REST: Overview .MD
Created January 5, 2018 16:15
GraphQL vs REST: Overview .MD

A few months back I wrote a comparison between RPC and REST for Smashing Magazine, and now I want to talk about the differences between REST and GraphQL: the new kid on the block.

GraphQL is incorrectly considered by some to be a "replacement" to REST. GraphQL is a newer concept, being released by Facebook publicly in 2015, whereas REST was a dissertation published by Roy Fielding in 2000, popularized by companies like Twitter (quite inaccurately) in 2006.

This article aims to cover a few notable differences, and make the following points:

REST and GraphQL are totally different GraphQL isn't a magic bullet, nor is it "better" You can definitely use both at the same time GraphQL is dope if used for the right thing

@odykyi
odykyi / JavaScriptLanguage.jsLanguageServicesImpl.external.lib.es2017.full.d.ts
Created January 10, 2018 10:16
JavaScriptLanguage.jsLanguageServicesImpl.external.lib.es2017.full.d.ts
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.