Skip to content

Instantly share code, notes, and snippets.

View sujith3g's full-sized avatar
👨‍💻
./~

Sujith G sujith3g

👨‍💻
./~
View GitHub Profile

Keybase proof

I hereby claim:

  • I am sujith3g on github.
  • I am sujith3g (https://keybase.io/sujith3g) on keybase.
  • I have a public key ASBL3vZ3BIgNkFpykois_SaUD0NJANsmKYKWrIsHoAQfWQo

To claim this, I am signing this object:

@sujith3g
sujith3g / meteor-random.py
Last active September 24, 2019 09:09
Generate a Meteor-style object ID from python for use in MongoDB
def genMeteorID(length=17):
UNMISTAKABLE_CHARS = "23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz"
randomString = ""
for i in range(length):
randomString += random.choice(UNMISTAKABLE_CHARS)
return randomString
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var LinkManager, LinkModule, SubContent;
SubContent = require('docxtemplater').SubContent;
LinkManager = require('./src/linkManager');
LinkModule = (function () {
LinkModule.prototype.name = 'link';
function LinkModule (options) {
escapeCsv = function(options) {
this.options = options || {
delimiter : ",",
quote : '"',
escape : '"'
};
};
escapeCsv.prototype.escape = function(field) {
if (field) {
@sujith3g
sujith3g / designer.html
Last active March 13, 2016 19:27
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@sujith3g
sujith3g / designer.html
Last active March 10, 2016 18:31
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@sujith3g
sujith3g / gist:1453b809fe9044a786da
Created February 12, 2016 14:02 — forked from osroca/gist:4327517
[How to] embed javascript libraries into the mongo shell
// mongo export to csv
// Usage "$ mongo localhost:27017/my_db script.js > test.csv "
cursor = db.collection.find();
var fields = [
"field1",
"field2",
"field3",
"field4",
"created_field"
];