Skip to content

Instantly share code, notes, and snippets.

View privateOmega's full-sized avatar
🎮
Focusing

Kiran Mathew Mohan privateOmega

🎮
Focusing
  • Hinge Health
  • Bangalore, India
  • 19:30 (UTC +05:30)
View GitHub Profile
@privateOmega
privateOmega / docker.txt
Last active June 19, 2016 19:36
docker inspect mattermost-preview
[
{
"Id": "a58a6b0e6d2a6e52b5600d208d4ba66a4892c857694803627bf093e68822f85b",
"Created": "2016-06-19T13:24:56.493383056Z",
"Path": "/bin/sh",
"Args": [
"-c",
"./docker-entry.sh"
],
"State": {
starting mysql
Initializing database
2016-06-19T13:24:59.604444Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-06-19T13:25:00.134892Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-06-19T13:25:00.380530Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3941acb9-3621-11e6-b21c-0242ac110002.
2016-06-19T13:25:00.438033Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-06-19T13:25:00.439104Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2016-06-19T13:25:15.918776Z 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2016-06-19T13:25:15.918820Z 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2016-06-19T13:25:15.918846Z 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resol
@privateOmega
privateOmega / project.pbxproj
Created April 5, 2017 06:51
Project.pbxproj file for React Native
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Image,
Dimensions,
TextInput,
Button,
TouchableOpacity,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@yaireo/tagify@2.10.1/dist/tagify.css">
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify@2.10.1/dist/tagify.min.js"></script>
@privateOmega
privateOmega / streams.js
Last active March 8, 2019 09:03
Stream Implementation Node.js
const { Duplex } = require('stream');
const duplexStream = new Duplex({
objectMode: true,
read() { },
write(chunk, encoding, callback) {
console.log('pull');
// Emulating slower write process compared to read speed.
setTimeout(() => {
console.log(`Write out: ${JSON.stringify(chunk)}`);
@privateOmega
privateOmega / knex-migration.js
Created March 22, 2019 03:54
Knex Migration failure test code.
'use strict';
exports.up = async knex => {
// Create Schema
await knex.raw('CREATE SCHEMA IF NOT EXISTS meraki');
// Load Extensions
await knex.raw('CREATE EXTENSION IF NOT EXISTS "uuid-ossp"');
// Roles
await knex.schema.withSchema('meraki').createTable('roles', table => {
table
@privateOmega
privateOmega / interval-creator.js
Created April 11, 2019 09:17
JS code to generate intervals between date
const createIntervals = (from, to, interval) => {
let time = new Date(from),
intervals = [];
do {
intervals.push(new Date(+time));
time.setMinutes(time.getMinutes() + interval);
} while (time <= new Date(to));
return intervals;
};
@privateOmega
privateOmega / commarize.js
Created November 28, 2019 13:10
commarize numbers with 2 digit precision
function commarize(number, min) {
min = min || 1e3;
// Alter numbers larger than 1k
if (number >= min) {
let units = ["k", "M", "B", "T"];
let order = Math.floor(Math.log(number) / Math.log(1000));
let unitname = units[order - 1];
let num = Number((number / 1000 ** order).toFixed(2));
// output number remainder + unitname
return num + unitname;
@privateOmega
privateOmega / pr.md
Created July 17, 2021 19:17 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: