Skip to content

Instantly share code, notes, and snippets.

View xDarkicex's full-sized avatar
🏠
Working from home

Gentry Rolofson xDarkicex

🏠
Working from home
View GitHub Profile
doctype html
html(lang="en")
head
block title
title My Application
meta(name="viewport" content="width=device-width, initial-scale=1")
link(rel='stylesheet' type="text/css" href='/static/assets/stylesheets/application.css')
link(rel='stylesheet' type="text/css" href='https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css')
//- link(rel='stylesheet' type="text/css" href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css')
@xDarkicex
xDarkicex / gzip.go
Created November 5, 2016 05:16
Example of caching and gzip, httprouter
package gzip
import (
"compress/gzip"
"io"
"net/http"
"strings"
"github.com/julienschmidt/httprouter"
)
@xDarkicex
xDarkicex / render.go
Created November 5, 2016 02:13
gzip weirdness
package helpers
import (
"bytes"
"compress/gzip"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os/exec"
@xDarkicex
xDarkicex / router.go
Created November 5, 2016 01:15
This is sample caching with router golang
func GetRoutes() *httprouter.Router {
router := httprouter.New()
application := controllers.Application{}
router.GET("/", application.Index)
fileServer := http.FileServer(http.Dir("public"))
router.GET("/static/*filepath", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
w.Header().Set("Vary", "Accept-Encoding")
w.Header().Set("Cache-Control", "public, max-age=7776000")
r.URL.Path = p.ByName("filepath")
@xDarkicex
xDarkicex / slider.js
Created January 5, 2016 17:08
broken Slider
var sliderIndex = 0;
var $images = $(".slide-group").children();
function slide(){
$images.fadeOut();
$($images[sliderIndex]).slideDown();
sliderIndex = (sliderIndex<$images.length-1)?sliderIndex+1:0;
}
function validate() {
if (document.getElementById('remember').checked) {
@xDarkicex
xDarkicex / 10-stunning-hover-effects-with-scss.markdown
Created April 23, 2015 21:25
10 stunning hover effects with scss
@xDarkicex
xDarkicex / Google-map-dynamic-sizing.markdown
Last active August 29, 2015 14:19
Google map dynamic sizing