Skip to content

Instantly share code, notes, and snippets.

View gauravchl's full-sized avatar
🌏
🧘‍♂️

Gaurav Chikhale gauravchl

🌏
🧘‍♂️
View GitHub Profile
@gauravchl
gauravchl / main.workflow
Created August 5, 2019 17:46
For medium
workflow "Build and Test" {
on = "push"
resolves = ["Run integration tests"]
}
action "Install dependencies" {
uses = "actions/npm@master"
runs = "npm install"
}
@gauravchl
gauravchl / package.json
Last active August 5, 2019 17:45
For medium
"scripts": {
"e2e": "testcafe chrome e2e/*.js --app 'yarn serve:build'",
"e2e:github": "testcafe chrome:headless e2e/*.js --app 'npm run serve:build'"
@gauravchl
gauravchl / gpg.md
Last active August 3, 2019 22:42
gpg installation osx
@gauravchl
gauravchl / convert.sh
Created July 20, 2019 03:46
webm converter
ffmpeg -i future.mov -vcodec libvpx-vp9 -b:v 4M future.webm
@gauravchl
gauravchl / paper.txt
Last active April 23, 2018 05:57
Study for how does a husband can sleep through EEE EEEE EEEEE of an alarm clock but not the gentle tap tap tap of laptop keyboard
|----Tap Tap-------| |----EE EEE EE-----|
| | | |
| | | |
|----------------------------------------------------------------------------------|
| | | |
| | | |
|<--Sleep Begins-->|<----------------In Sleep------------------>|<---Sleep Ends--->|
| | | |
| | | |
@gauravchl
gauravchl / package.json
Last active January 14, 2018 07:41
webpack setups
/* Just for es6 */
{
"name": "webapp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch --progress",
"build": "webpack -p"
@gauravchl
gauravchl / commit.md
Created December 25, 2017 15:43
Git commit message spec

Git Commit Messages

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally
  • When only changing documentation, include [ci skip] in the commit description
  • Consider starting the commit message with an applicable emoji:
@gauravchl
gauravchl / cryptography.md
Last active January 26, 2023 17:26
Useful commands for cryptography need

sha256 of a file

openssl sha -sha256 ws-test.js

sha256 of string

echo -n 'your string' | opsnssl sha -sha256

Random password 192 character

openssl rand 192

Random password in file

@gauravchl
gauravchl / server.js
Created December 17, 2017 10:30
execute local scripts from node server
const handleRequest = (req, res) => {
console.log('new Request!')
let child = execFile('/Users/om/some-script.py', [req.body])
child.stdout.on('data', data => console.log('data: ', data))
child.on('error', (err) => console.log('error:', err))
child.on('exit', (c, s) => console.log('child exit', c, s))
res.statusCode = 200;
res.end();
@gauravchl
gauravchl / server.js
Last active January 14, 2018 12:41
Simple node server
#!/usr/bin/env node
const http = require('http');
const getBody = (req) => {
return new Promise(resolve => {
let body = '';
req.on('data', chunk => { body += chunk });
req.on('end', _ => resolve(body));
})