Skip to content

Instantly share code, notes, and snippets.

@manishtpatel
manishtpatel / main.go
Last active May 7, 2021
GoLang Encrypt string to base64 and vice versa using AES encryption.
View main.go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@toolmantim
toolmantim / Makefile
Last active Jan 9, 2021
An example of using Make instead of Grunt for fast, simple and maintainable front-end asset compilation.
View Makefile
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
@mikedewar
mikedewar / df2json.py
Created Dec 16, 2011
A little script to convert a pandas data frame to a JSON object. Is there a better way?
View df2json.py
"""
tiny script to convert a pandas data frame into a JSON object
"""
import ujson as json
import pandas
import numpy as np
df = pandas.DataFrame({
"time" : [1,2,3,4,5],
@rolo
rolo / gist:1481128
Created Dec 15, 2011
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
View gist:1481128
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update