Skip to content

Instantly share code, notes, and snippets.

View cryptic022's full-sized avatar

Pankaj Kumar cryptic022

  • Autodesk
  • Pune India
View GitHub Profile
@cryptic022
cryptic022 / generate-ssh-key.sh
Created April 3, 2020 05:59 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
https://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/
https://support.apple.com/en-in/guide/terminal/trmlshtcts/mac
https://dev.to/webdevchallenges/summary-a-brief-introduction-to-vim-gcf
https://webdevchallenges.com/summaries/vim/
https://www.barbarianmeetscoding.com/blog/2018/10/14/exploring-vim
https://vim.rtorr.com/
https://devhints.io/vim#operators
https://phpenthusiast.com/blog/10-must-know-vscode-shortcuts-and-tricks
https://www.growingwiththeweb.com/2017/03/mastering-vscodes-terminal.html
https://code.visualstudio.com/docs/python/python-tutorial
https://vscodecandothat.com/
https://www.smashingmagazine.com/2018/01/visual-studio-code/
Hide Horizontal ScrollBar ->
div::-webkit-scrollbar{
display: none;
}
@cryptic022
cryptic022 / Flex.js
Created September 15, 2017 10:59 — forked from jorilallo/Flex.js
Flexbox component for React
// @flow
import React from 'react';
import styled from 'styled-components';
type GlobalCssValues = 'initial' | 'inherit' | 'unset';
type WrapValue = 'nowrap' | 'wrap' | 'wrap-reverse' | GlobalCssValues;
type JustifyValue =
| 'center'
@cryptic022
cryptic022 / nativeJavaScript.js
Created September 15, 2017 09:26 — forked from alexhawkins/nativeJavaScript.js
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
@cryptic022
cryptic022 / gist:a9fda8c58c823b32fe90337ca2dac275
Created May 12, 2017 12:19 — forked from dalethedeveloper/gist:1503252
Mobile Device Detection via User Agent RegEx

#Mobile Device Detection via User Agent RegEx

Yes, it is nearly 2012 and this exercise has been done to death in every imaginable language. For my own purposes I needed to get the majority of non-desktop devices on to a trimmed down, mobile optimized version of a site. I decided to try and chase down an up-to-date RegEx of the simplest thing that could possibly work.

I arrived at my current solution after analyzing 12 months of traffic over 30+ US based entertainment properties (5.8M+ visitors) from Jan - Dec 2011.

The numbers solidified my thoughts on the irrelevancy of including browsers/OSes such as Nokia, Samsung, Maemo, Symbian, Ipaq, Avant, Zino, Bolt, Iris, etc. The brass tacks of the matter is that you certainly could support these obscure beasts, but are you really going to test your site on them? Heck, could you even find one?! Unless the folks that pay you are die hard Treo users my guess is "No".

Interestingly enough my research shows that /Mobile/ is more efficient than **/iP(

@cryptic022
cryptic022 / ultimate-ut-cheat-sheet.md
Created August 11, 2016 11:43 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies