Skip to content

Instantly share code, notes, and snippets.

View gautamsi's full-sized avatar
🎯
Focusing

Gautam Singh gautamsi

🎯
Focusing
View GitHub Profile
@wbroek
wbroek / fetch-axios-ntlm.js
Last active April 15, 2021 00:11
NTLM authentication with Axios and with none Node JS modules
/**
* Copyright (c) 2019 Wouter van den Broek https://github.com/wbroek/
* All rights reserved.
*/
const axios = require('axios');
const ntlm = require('./ntlm');
// NODE JS
const https = require('https');
const httpsAgent = new https.Agent({ keepAlive: true });
@freshcutdevelopment
freshcutdevelopment / app.html
Last active November 21, 2018 18:46
Aurelia Gist - Add book form
<template>
<require from="book-form"></require>
<book-form></book-form>
<div class="notification" show.bind="notification.length > 0">
${notification}
</div>
</template>
@bijoutrouvaille
bijoutrouvaille / geofire.d.ts
Last active March 8, 2019 00:35
GeoFire Typescript Declarations
declare module 'geofire' {
import firebase from 'firebase'
namespace GeoFire {
type Dictionary<T> = { [key:string]: T }
type Latitude = number
type Longitude = number
type Ref = firebase.database.Reference
type Location = [Latitude, Longitude]
type CenterCriteria = {center:Location}
type RadiusCriteria = {radius: number}
@episage
episage / UniqueIdGenerator.ts
Created May 17, 2016 18:44 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
// https://gist.github.com/mikelehen/3596a30bd69384624c11
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
@Scapal
Scapal / calendar.js
Last active June 18, 2019 08:08
Aurelia FullCalendar integration
import {
inject, noView, bindable, bindingMode,
customElement, BindingEngine, inlineView
} from 'aurelia-framework';
import 'jquery';
import moment from 'moment';
import {fullCalendar} from 'fullcalendar';
@customElement('calendar')
@gautamsi
gautamsi / ntlmXHRApi.js
Last active February 7, 2018 00:09
ews-javascript-api NTLM Auth with NodeJS
//see reference implementation in ews-javascript-api_repo@github\test\MockXHRApi.ts, this one is transpiled JS
// ----- Updated to process errors in ntlm library gracefully
var PromiseFactory = require("ews-javascript-api").PromiseFactory;
var httpntlm = require('httpntlm');
var ntlmXHRApi = (function () {
function ntlmXHRApi(user, password) {
this.userName = user;
this.password = password;
}
ntlmXHRApi.prototype.xhr = function (xhroptions) {
@webteckie
webteckie / keystone_roles_permissions.md
Last active November 21, 2021 11:35
Keystone Roles and Permissions

Keystone Roles & Permissions Support

The following documents the user permission support in keystone based on the support being added via PR #2111. Permissions are based on roles. If a user has a role and the list also specifies that role for any of its CRUD operations then it is permissive for the user to perform whichever CRUD operation matches the role. All users must define, at least, one role. The following are guidelines for adding role/permission support to your application:

Define a Role List Model:

@Thanood
Thanood / ag-grid.js
Last active March 8, 2016 13:47
simple ag-grid wrapper
import { bindable, inlineView } from 'aurelia-framework';
import * as ag from 'ag-grid';
@inlineView(`
<template class="ag-blue" style="align-self: stretch; flex-grow: 1; -ms-flex: 0 1 auto; flex: 1 1 100%;">
<require from="ag-grid/dist/ag-grid.css"></require>
<require from="ag-grid/dist/theme-blue.css"></require>
</template>
`)
export class AgGrid {
@manigandham
manigandham / rich-text-html-editors.md
Last active June 10, 2024 15:49
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@mikelehen
mikelehen / generate-pushid.js
Created February 11, 2015 17:34
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/