Skip to content

Instantly share code, notes, and snippets.

View kinshuk4's full-sized avatar

Kinshuk kinshuk4

View GitHub Profile
@kinshuk4
kinshuk4 / nginx-latest.sh
Last active August 23, 2016 18:43 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
@kinshuk4
kinshuk4 / 0_reuse_code.js
Created August 21, 2016 10:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kinshuk4
kinshuk4 / docker-golang.md
Created August 21, 2016 10:29 — forked from johnjansen/docker-golang.md
Try Golang, without Golang

Experiment with golang without polluting your local

  1. install docker ... really, you need to look at containers !!!

  2. docker pull golang

  3. pretend we have go installed

        echo 'alias go="docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang go "' >> ~/.bash_profile
        source ~/.bash_profile
    
package main
import "io"
import "os"
import "strings"
import "bytes"
func main() {
r1 := strings.NewReader("Hello")
r2 := bytes.NewReader([]byte(" World!"))
package main
type member struct {
name string
race string
}
func (m member) intro() {
println("Hi, I'm " + m.name)
}
package main
import "fmt"
func main() {
type member struct {
name string
race string
}
package main
func main() {
t3s := map[string]string{
"Krillin": "Human",
"Gohan": "Saiyan",
"Dende": "Namekian",
}
for name, race := range t3s {
package main
import "fmt"
func main() {
t3s := map[string]string{
"Krillin": "Human",
"Gohan": "Saiyan",
"Dende": "Namekian",
}
Packages:
- advanced-open-file
- git-projects
- project-manager
- highlight-selected
- sort-lines
Theme:
- atom-material-ui with OneDark syntax theme
@kinshuk4
kinshuk4 / validators.py
Created August 8, 2016 16:03 — forked from jpadilla/validators.py
DomainNameValidator adapted from Django's EmailValidator.
import re
from django.utils.encoding import force_text
from django.core.exceptions import ValidationError
class DomainNameValidator(object):
"""
Domain name validator adapted from Django's EmailValidator.
"""