Skip to content

Instantly share code, notes, and snippets.

View saiumesh535's full-sized avatar
🤒
so long

sai umesh saiumesh535

🤒
so long
View GitHub Profile
@saiumesh535
saiumesh535 / main.go
Created April 23, 2020 11:12
go routines example
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
@saiumesh535
saiumesh535 / gist:2ff659b20777b8d8a6d3d548c88dcef6
Created February 27, 2020 05:17 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@saiumesh535
saiumesh535 / git.command
Created November 22, 2019 08:19
git commands
Re-clone
GIT=$(git rev-parse --show-toplevel)
cd $GIT/..
rm -rf $GIT
git clone ...
✅ Deletes local, non-pushed commits
✅ Reverts changes you made to tracked files
✅ Restores tracked files you deleted
✅ Deletes files/dirs listed in .gitignore (like build files)
✅ Deletes files/dirs that are not tracked and not in .gitignore
package main
import "fmt"
type Http struct {
}
func (http *Http) Get(url string) string {
return fmt.Sprintf("the result from %s is nothing", url)
}
@saiumesh535
saiumesh535 / package.json
Created April 15, 2019 16:34
package json for TS node
"scripts": {
"dev": "tsc-watch --onSuccess \"cross-env NODE_ENV=development node build/src/index.js\"",
"prod":"tsc && cross-env NODE_ENV=production node build/src/index.js",
"lint": "tslint --project tslint.json"
}
@saiumesh535
saiumesh535 / tslint.json
Created April 15, 2019 16:33
tslint.json
{
"defaultSeverity": "error",
"extends": "./node_modules/tslint/lib/configs/recommended",
"linterOptions": {
"exclude": [
"node_modules/**"
]
},
"jsRules": {},
"rules": {
@saiumesh535
saiumesh535 / tsconfig.json
Last active September 20, 2019 13:29
tsconfig.json
{
"compilerOptions": {
"incremental": true,
"target": "es2017",
"module": "commonjs",
"lib": ["es2017"],
"types": ["node"],
"outDir": "./build",
"rootDir": "./",
"strict": true,
@saiumesh535
saiumesh535 / git.helper.md
Last active June 15, 2020 07:08
Different users for your git project
  1. First goto project folder
  2. Initialize git by git init command
  3. Set username with git config user.name "username” command
  4. Set email with git config user.email "[email protected] command
  5. Now create a repository in GitHub
  6. Now we will either set or add origin based on project status
  7. As github disabled using plain password in git url we need to get github personal access token from here
  8. Newly added git project git remote add origin https://username:[email protected]/saiumesh535/chi-http.git
  9. Existing git project
@saiumesh535
saiumesh535 / readFile.rs
Created March 13, 2019 18:22
Error hnadling in Rust - Result
use std::io;
use std::io::Read;
use std::fs::File;
fn read_from_file(file_path: &'static str) -> Result<String, io::Error> {
let mut file_data = String::new();
// now let's try to read file
@saiumesh535
saiumesh535 / custom.rs
Last active March 13, 2019 19:01
Error handling in Rust Option - improved
fn read_from_vec(input: &Vec<i32>, index: usize) -> Result<i32, &'static str> {
return match input.get(index) {
Some(value) => Ok(*value),
None => Err("Out of bound exception")
}
}