Skip to content

Instantly share code, notes, and snippets.

View gautamsi's full-sized avatar
🎯
Focusing

Gautam Singh gautamsi

🎯
Focusing
View GitHub Profile
@ksafranski
ksafranski / Common-Currency.json
Last active November 15, 2024 10:05
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@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).
*/
@manigandham
manigandham / rich-text-html-editors.md
Last active November 14, 2024 09:30
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

@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 {
@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:

@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) {
@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')
@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).
@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}
@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>