Skip to content

Instantly share code, notes, and snippets.

View hmelenok's full-sized avatar
🙊
Coding

Mykyta Khmel hmelenok

🙊
Coding
View GitHub Profile
{
"vars": {},
"css": [
"print.less",
"grid.less",
"forms.less",
"responsive-utilities.less"
],
"js": [
"tooltip.js",
curl -XDELETE 'http://localhost:9200/_all'
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1463411293" LAST_MODIFIED="1463418384" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3>
<DL><p>
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Preferences for __UP_myname__" height="250" />
<UserPref name="myname" display_name="Name" required="true" />
<UserPref name="myphoto" display_name="Photo" default_value="http://doc.examples.googlepages.com/rowan-headshot.jpg"/>
<UserPref name="mychoice" display_name="Show Photo?" datatype="bool" default_value="true"/>
<UserPref name="mycolor" display_name="Color" default_value="Yellow" datatype="enum" >
<EnumValue value="Red" />
<EnumValue value="Aqua" />
<EnumValue value="Lime" />
<Extension id="from" type="contextExtractor">
<Name>Email Sender</Name>
<Url>google.com:SenderEmailExtractor</Url>
<Param name="sender_email" value="my_boss@my_domain.com"/>
<Triggers ref="bossIsCalling"/>
<Scope ref="senderScope"/>
<Container name="mail"/>
</Extension>
@hmelenok
hmelenok / basae64IsoToUTF8.js
Created September 1, 2016 16:50
function to decode in js gmail base64 strings to normal UTF8 language
function base64DecodetoUTF8(string) {
return decodeURIComponent(escape(atob(string.split('-').join('+').split('_').join('/')) ));
}
@hmelenok
hmelenok / sorting.js
Created June 4, 2018 13:42
javascript natural sort collection
import naturalSort from 'javascript-natural-sort';
import emojiStrip from 'emoji-strip';
import {cloneDeep} from 'lodash';
import {isOrgLib, isPersonalLib} from './directory';
import {getTitle} from './properties';
naturalSort.insensitive = true;
/**
import {Api} from '@shelf/sdk';
import {Meteor} from 'meteor/meteor';
const graphqlConfig = {
apiKey: Meteor.settings.public.decisionTree.apiKey,
apiUrl: `https://${Meteor.settings.public.decisionTree.graphqlAPIHost}/graphql`
};
// Todo: Setup Apollo during Visual Editing implementation and switch to QueryLayer
class DecisionTreeApi extends Api {
export const goToDecisionStep = (stepId = 'Step#1', gemId) => async (dispatch, getState) => {
const {
gemDecisionTree: {nodes}
} = getState();
const alreadyFetchedStep = nodes[stepId];
if (!isEmpty(alreadyFetchedStep)) {
return dispatch(setActiveDecisionStep(alreadyFetchedStep));
}
import AWSAppSyncClient, {createAppSyncLink} from 'aws-appsync';
import {PureQueryOptions} from 'apollo-client';
import {MutationOptions, QueryOptions, ApolloQueryResult} from 'apollo-client';
import {map} from 'lodash';
import AppSyncConfig from '../../aws.config';
import {getAccessToken, getDefaultQueryParams, getMeteorTokenString} from '../helpers/apiHelper';
import {logError, logResponse} from './apolloLogHelpers';
import '../polyfills/server-fetch';
import {InMemoryCache} from 'apollo-cache-inmemory';
import {setContext} from 'apollo-link-context';