Skip to content

Instantly share code, notes, and snippets.

Verifying my Blockstack ID is secured with the address 151Qz6KT4WrdFRg1G828yU3zjTNuYq1fa2 https://explorer.blockstack.org/address/151Qz6KT4WrdFRg1G828yU3zjTNuYq1fa2
@PistachioPony
PistachioPony / tip.py
Created June 5, 2017 21:22
A simple tip calculator in python
# Tip calculator
# (15%, 18% and 20%)
while True:
try:
user_input = input("What is the total of your check? > $")
total_check = float(user_input)
break
except ValueError:
print("I'm sorry, looks like you typed something incorrectly. Try typing in a number! :)")
@PistachioPony
PistachioPony / Ball Behavior
Created June 5, 2017 18:29
This script goes on the ball
using UnityEngine;
using System.Collections;
public class mmBallRoll : MonoBehaviour {
public mmGameManagerController gm;
private Rigidbody myRb;
// Use this for initialization
void Start () {
@PistachioPony
PistachioPony / Golang on EC2
Last active August 29, 2015 14:20
How to put latest version of golang on EC2 server
First get into your EC2 server
If you have already run
$ sudo apt-get install golang
and you have
$ go version
go version go1.2.1 linux/amd64
or something else out of date, you need to remove it before anything
$ rm -r go
$ sudo apt-get remove golang
@PistachioPony
PistachioPony / main.go
Last active August 29, 2015 14:20 — forked from mschoebel/main.go
sessions/cookies Go
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@PistachioPony
PistachioPony / Go Quickstart
Created April 7, 2015 16:42
Go Quickstart
$ mkdir $HOME/mygo_projects
$ export GOPATH=$HOME/mygo_projects
$ go get github.com/gocraft/web
@PistachioPony
PistachioPony / Django Quickstart
Last active August 29, 2015 14:18
Django Quickstart
Assuming you have virtualenv,virtual wrapper, python and pip already installed.
$mkvirtualenv yourproject //this creates your project in a virtual environment
You will see you are in your virtualenv project because it will look like this -
(yourproject)yourcomputer~/desktop$
$pip install django // install django
$pip install django toolbelt
$django-admin.py startproject yourproject //this starts django off
Now cd into your new project folder
cd yourproject
Now get Core
Once you have Hugo installed - type in terminal
hugo help
if you see the help options, all is good. Now create a folder in directory of choice
mkdir myBlog
cd into into your new folder
cd myblog
Now you can create your hugo blog by typing
hugo new site .
The . tells it to put it in the directory it is in,(but you can put another direct path if you like).
Open up your folder in your editor and you will see new folders there.