Skip to content

Instantly share code, notes, and snippets.

View krishna2nd's full-sized avatar
🎯
Focusing

Krishna krishna2nd

🎯
Focusing
View GitHub Profile
@krishna2nd
krishna2nd / wg_routines.go
Created October 23, 2017 15:06
Wait for group + routines Golang
package main
import (
"fmt"
"sync"
)
func main() {
var wg = sync.WaitGroup{}
for v := range []int{1, 2, 3, 4, 5, 6} {
@krishna2nd
krishna2nd / channels.go
Created October 25, 2017 01:32
Go dual channels
package main
import (
"fmt"
)
func printch(ch1, ch2, q chan int) {
for {
select {
case x := <-ch1:
@krishna2nd
krishna2nd / Go Select Implementation.md
Last active October 25, 2017 02:45
Go Select Implementation

Go Select Implementation

There are several steps to execute a select block:

  1. Evaluate all involved channels and values to be potentially sent, from top to bottom and left to right.
  2. Randomise the case orders for polling (the default branch is treated as a special case). The corresponding channels of the orders may be duplicate. The default branch is always put at the last position.
  3. sort all involved channels to avoid deadlock in the next step. No duplicate channels are in the first N channels of the sorted result, where N is the number of involved channels in the select block. Below, the sorted lock orders mean the the first N ones.
  4. lock all involved channels by the sorted lock orders in last step.
  5. poll each cases in the select block by the randomised case orders:
@krishna2nd
krishna2nd / gist:494cd5618a32047465467c011f84ffd8
Created November 5, 2017 10:59 — 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:
@krishna2nd
krishna2nd / gist:4c177813db8be918c2003000c2d76085
Created November 5, 2017 10:59 — 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:
?
1
2
3
4
5
6
7
8
9
@krishna2nd
krishna2nd / react-intl-en.js
Created December 25, 2017 02:38
Sample React intl file
!function(e, a) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = a() : "function" == typeof define && define.amd ? define(a) : (e.ReactIntlLocaleData = e.ReactIntlLocaleData || {},
e.ReactIntlLocaleData.en = a())
}(this, function() {
"use strict";
return [{
locale: "en",
pluralRuleFunction: function(e, a) {
var n = String(e).split(".")
, l = !n[1]
@krishna2nd
krishna2nd / gist:da4dcec65fe17134da1d8f50efca484e
Created January 15, 2018 07:26 — forked from alimd/gist:3344523
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | πŸ˜„ | πŸ˜† | 😊 | πŸ˜ƒ | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | πŸ˜† | 😁 | πŸ˜‰ | :wink2: | πŸ‘… | πŸ˜’ | πŸ˜… | πŸ˜“

😩 | πŸ˜” | 😞 | πŸ˜– | 😨 | 😰 | 😣 | 😒 | 😭 | πŸ˜‚ | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😑 | 😀 | πŸ˜ͺ | πŸ˜‹ | 😷

😎 | 😡 | πŸ‘Ώ | 😈 | 😐 | 😢 | πŸ˜‡ | πŸ‘½ | πŸ’› | πŸ’™ | πŸ’œ | ❀️ | πŸ’š | πŸ’” | πŸ’“ | πŸ’— | πŸ’• | πŸ’ž | πŸ’˜ | ✨

@krishna2nd
krishna2nd / react_samples_list.md
Created February 9, 2018 16:06 — forked from jpalala/react_samples_list.md
React Samples List