Skip to content

Instantly share code, notes, and snippets.

View mukulrawat1986's full-sized avatar
💭
It's compilcated

Mukul Rawat mukulrawat1986

💭
It's compilcated
View GitHub Profile
@mukulrawat1986
mukulrawat1986 / custom_json.go
Created September 4, 2019 15:36 — forked from mdwhatcott/custom_json.go
Example of implementing MarshalJSON and UnmarshalJSON to serialize and deserialize custom types to JSON in Go. Playground: http://play.golang.org/p/7nk5ZEbVLw
package main
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
)
func main() {
@mukulrawat1986
mukulrawat1986 / Main.java
Created December 13, 2018 12:47
WittyCleanNature created by mukulrawat1986 - https://repl.it/@mukulrawat1986/WittyCleanNature
class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@mukulrawat1986
mukulrawat1986 / iterm2-solarized.md
Created September 13, 2018 06:39 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

// simple program to use json and download images from a subreddit
package main
import (
"encoding/json"
"errors"
"fmt"
"image"
"image/gif"
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
var t int
// A concurrent CracklePop Program
package main
import (
"fmt"
)
// Create a goroutine that sends infinite empty string on a channel
// and returns the channel
package main
import (
"bufio"
"fmt"
"log"
"os"
)
// Define a type to implement a bktree node
@mukulrawat1986
mukulrawat1986 / PE22.py
Created June 16, 2015 17:06
Project Euler 22
# function to get the alphabetical value
def value(char):
return ord(char) - 64
# open file and sort the strings
file = open('names.txt','r')
names = file.read().split(',')
names = sorted(names)
total = 0
@mukulrawat1986
mukulrawat1986 / fizzbuzz
Created April 15, 2015 21:39
Code wars Fizzbuzz
def fizzbuzz(n):
# your code here
return ['FizzBuzz' if i%15 == 0 else "Fizz" if i%3==0 else "Buzz" if i%5==0 else i for i in xrange(1,n+1)]