Skip to content

Instantly share code, notes, and snippets.

@nemisj
nemisj / no-strict.js
Last active August 24, 2016 12:18
Const implementations in node.js
/*
node: v4.4.7 - MMMM
node: v5.12.0 - MMMM
node: v6.3.1 - Maks
*/
const s = 'Maks';
for (var i = 0;i < s.length; i++) {
const ch = s.charAt(i);
console.log('ch:' + ch);
@nemisj
nemisj / keybase.md
Created September 27, 2016 12:47
keybase.md

Keybase proof

I hereby claim:

  • I am nemisj on github.
  • I am maksnemisj (https://keybase.io/maksnemisj) on keybase.
  • I have a public key whose fingerprint is BFC7 DC90 68C6 9FE4 862F 5642 3E55 5364 7EBD C494

To claim this, I am signing this object:

'use strict';
const parse = require('json-safe-parse');
module.exports = (str) => {
let json = str;
if (typeof str === 'string') {
const toParse = str.trim();
if (toParse !== '') {
@nemisj
nemisj / index-correct.jsx
Last active February 16, 2017 19:12
Conditional comments for IE in react.js
renderHead() {
return (
var comment = '<!--[if lte IE 9]><script src="/public/media.match.js"></script><![endif]-->';
<head>
<title>Website title</title>
<meta name="react-comment-hack"
dangerouslySetInnerHTML={{__html: comment}}>
</meta>
</head>
);
@nemisj
nemisj / npm-tmp-clean.sh
Last active February 4, 2018 01:15
Removing npm tmp after install
#!/usr/bin/env bash
# this is pid of the bash we are in
bash_pid=$$
bash_pid=$(echo -e ${bash_pid} | tr -d '[[:space:]]');
# this is shell of the bash
shell_pid=$(ps -p ${bash_pid} -o ppid=;)
shell_pid=$(echo -e ${shell_pid} | tr -d '[[:space:]]');
@nemisj
nemisj / tig-theme
Created December 11, 2020 13:04
Theme for tig, a bit better than default
# vim: set expandtab sw=4 tabstop=4:
# *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
# general
color default 15 235
color cursor 15 241
color title-focus 242 221
color title-blur 242 221
color delimiter 213 default
color author 156 default
@nemisj
nemisj / .tigrc
Created December 11, 2020 13:07
simple tig config with tig-theme
source ~/.tig/tig-theme
bind main R !git rebase -i %(commit)^ --autosquash
bind diff R !git rebase -i %(commit)^ --autosquash