Skip to content

Instantly share code, notes, and snippets.

@jenux
jenux / mouse-cursor-gradient-tracking.css
Created March 30, 2022 07:07
Mouse cursor gradient tracking #CSS
/*
<button class="mouse-cursor-gradient-tracking">
<span>Hover me</span>
</button>
*/
.mouse-cursor-gradient-tracking {
position: relative;
background: #7983ff;
padding: 0.5rem 1rem;
@jenux
jenux / index-array-based-on-function.js
Last active March 30, 2022 03:40
[Index array based on function] #Array #Object #30secondsofcode
const indexBy = (arr, fn) => arr.reduce((obj, val, i) => {
obj[fn(val, i, arr)] = val
return obj
}, {})
// Examples
indexBy([
{ id: 10, name: 'apple' },
{ id: 20, name: 'orange' }
], x => x.id)
@jenux
jenux / diff2html.sh
Created July 25, 2019 02:26
Pretty Diff
#!/bin/bash
#
# Convert diff output to colorized HTML.
# (C) Mitch Frazier, 2008-08-27
# http://www.linuxjournal.com/content/convert-diff-output-colorized-html
# Modified by stopyoukid
#
html="<html><head><meta charset=\"utf-8\"><title>Pretty Diff</title><style>body {text-align: center;}#wrapper {display: inline-block;margin-top: 1em;min-width: 800px;text-align: left;}h2 {background: #fafafa;background: -moz-linear-gradient(#fafafa, #eaeaea);background: -webkit-linear-gradient(#fafafa, #eaeaea);-ms-filter: \"progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')\";border: 1px solid #d8d8d8;border-bottom: 0;color: #555;font: 14px sans-serif;overflow: hidden;padding: 10px 6px;text-shadow: 0 1px 0 white;margin: 0;}.file-diff {border: 1px solid #d8d8d8;margin-bottom: 1em;overflow: auto;padding: 0.5em 0;}.file-diff > div {width: 100%:}pre {margin: 0;font-family: \"Bitstream Vera Sans Mono\", Courier, monospace;font-size: 12px;line-height: 1.4em;text-indent: 0.5em;}.file {color:
@jenux
jenux / dev-lib-tools-collection.md
Last active March 6, 2019 02:21
Bookmarked Dev Library/Tools

Bookmarked Dev Library/Tools

JavaScript

The jsPlumb Toolkit is an advanced, standards-compliant and easy to use library for building Javascript connectivity based applications

1-5 developers $3500

Animation

@jenux
jenux / front-boilerplate.md
Created November 30, 2018 04:22
Front boilerplate

react

create-react-app

$ npm install -g create-react-app
$ create-react-app my-app
$ cd my-app
$ npm start

react-boilerplate

@jenux
jenux / diff2html.sh
Created July 31, 2017 05:07 — forked from stopyoukid/diff2html.sh
Script that takes a git diff and outputs an html file in GitHub style
#!/bin/bash
#
# Convert diff output to colorized HTML.
# (C) Mitch Frazier, 2008-08-27
# http://www.linuxjournal.com/content/convert-diff-output-colorized-html
# Modified by stopyoukid
#
html="<html><head><meta charset=\"utf-8\"><title>Pretty Diff</title><style>body {text-align: center;}#wrapper {display: inline-block;margin-top: 1em;min-width: 800px;text-align: left;}h2 {background: #fafafa;background: -moz-linear-gradient(#fafafa, #eaeaea);background: -webkit-linear-gradient(#fafafa, #eaeaea);-ms-filter: \"progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')\";border: 1px solid #d8d8d8;border-bottom: 0;color: #555;font: 14px sans-serif;overflow: hidden;padding: 10px 6px;text-shadow: 0 1px 0 white;margin: 0;}.file-diff {border: 1px solid #d8d8d8;margin-bottom: 1em;overflow: auto;padding: 0.5em 0;}.file-diff > div {width: 100%:}pre {margin: 0;font-family: \"Bitstream Vera Sans Mono\", Courier, monospace;font-size: 12px;line-height: 1.4em;text-indent: 0.5em;}.file {color:
@jenux
jenux / git-proj-contributing.md
Created July 26, 2017 03:39
git-project-contributing, copy from node contributing
@jenux
jenux / git-committed-between-dates.sh
Created July 26, 2017 03:18
get committed feature name between dates
$ git log --oneline --decorate --graph --since “<start date>" --until “<end date>" --author “<Author name> <Author email ID>" | awk '{print $3}' | grep "OPUS-*"
# One example is,
$ git log --oneline --decorate --graph --since "MAY 08 2017" --until "MAY 12 2017" --author "Jenux <ijenux@gmail.com>" | awk '{print $3}' | grep "OPUS-*”
@jenux
jenux / bash-usage.sh
Created July 26, 2017 03:18
bash usage sample
usage() {
echo "Usage: $0 [-s <45|90>] [-p <string>]" 1>&2; exit 1;
}
while getopts ":s:p" o; do
case "${o}" in
s)
s=${OPTARG}
((s == 45 || s == 90)) || usage
;;