Skip to content

Instantly share code, notes, and snippets.

Avatar
💤
lore:> hi knowledge

Jerin taurenshaman

💤
lore:> hi knowledge
View GitHub Profile
View disable-tab-nav.js
document.onkeydown = function (evt) {
if (evt.which === 9) {
//console.log(evt);
return false;
}
}
// source: https://www.sanwebcorner.com/2016/07/how-to-disable-tab-key-in-web-page.html
// if wanna disable a spesific element:
//<input tabindex="-1" placeholder="NoTabIndex" />
View katex-module-for-codex-editorjs.js
class KatexModule {
constructor({ data, api }) {
this.data = data;
this.api = api;
this.wrapper = undefined;
this.settings = [
{
name: 'edit',
title: 'Edit',
View 3box.txt
did:3:bafyreifq6fa7gz5w65lkul5qbjsbiflu5geuzo5o5dzo7cs3dkm2msnqvm
@taurenshaman
taurenshaman / Compare two numbers no convert
Last active Sep 1, 2018
compare two numbers stored as strings without converting them to double/int/float
View Compare two numbers no convert
// https://stackoverflow.com/a/14468767
var numbers = new string[] { "100" ,"200", "100.1" , "200.1" };
int N = 100;
var max = numbers.Select(n => n.Split('.'))
.OrderByDescending(p => p[0].PadLeft(N,'0'))
.ThenByDescending(p => p.Length > 1 ? p[1].PadRight(N, '0') : "")
.Select(p => p.Length > 1 ? p[0] + "." + p[1] : p[0])
.First();
@taurenshaman
taurenshaman / Append or update
Created Jun 14, 2013
Simple Enhancement for User's password @ FunnelWeb
View Append or update
【add Script0033.sql】
--add Salt field to User table
alter table $schema$.[User] add [Salt] nchar(32) null
go
【FunnelWeb.Model.Authentication.Mappings.UserMapping.cs】
Append:
@taurenshaman
taurenshaman / BrightstarDB.Jobs.sql
Last active Dec 17, 2015
add a prefix "Brightstar_" to BrightstarDB/BrightstarDB/tree/master/src/azure/sql/Jobs.sql and relative SqlJobQueue.cs
View BrightstarDB.Jobs.sql
/**
* Creates the job queue table and stored procedures in the database
*/
DROP ROLE brightstar_role_gateway
GO
DROP PROCEDURE [dbo].[Brightstar_CompleteJob]
GO
DROP PROCEDURE [dbo].[Brightstar_GetJob]
You can’t perform that action at this time.