Skip to content

Instantly share code, notes, and snippets.

Jason Sich jasich

  • Michigan
Block or report user

Report or block jasich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jasich
jasich / copy.cljs
Created Jan 29, 2018
Browser Copy in CLJS
View copy.cljs
(defn copy-text-from-elem
[elem-id]
(let [elem (.getElementById js/document elem-id)]
(.select elem)
(try
(if (.execCommand js/document "copy")
"Copied to Clipboard!!"
"Sorry Couldn't Copy")
(catch :default e
"Sorry Couldn't Copy"))))
View Omakase
Omakase: https://i.imgflip.com/20c9zd.jpg
@jasich
jasich / reload-video-sources.sh
Created Mar 22, 2017
Update list of video sources for Slack & Sococo
View reload-video-sources.sh
sudo killall VDCAssistant
@jasich
jasich / scroll.cljs
Created Dec 11, 2016
ClojureScript scroll element into view
View scroll.cljs
;; Based on https://github.com/GabrielDelepine/smooth-scroll/blob/main/smooth-scroll.js
(ns example.scroll)
(def speed 500)
(def moving-frequency 15)
(defn cur-doc-top []
(+ (.. js/document -body -scrollTop) (.. js/document -documentElement -scrollTop)))
(defn element-top [elem top]
View dotnetlayout.md
$/
  docs/
  src/
  tests/
  samples/
  artifacts/
  packages/
  build/
  lib/
@jasich
jasich / gist:1ad1d22969cd17b79889
Last active Aug 29, 2015
Go Chunks of Base64 Image
View gist:1ad1d22969cd17b79889
image := make([]byte, asset.BlobInfo.Size)
reader := blobstore.NewReader(ctx, asset.BlobInfo.BlobKey)
reader.Read(image)
imageAsBase64 := base64.StdEncoding.EncodeToString(image)
megabyte := (500)
totalSize := len(imageAsBase64)
totalChunks := int(math.Ceil(float64(totalSize) / float64(megabyte)))
@jasich
jasich / gist:a1ea2f6a3d195fc57f01
Created Jul 22, 2014
Golang BasicAuth Middleware
View gist:a1ea2f6a3d195fc57f01
package security
import (
"encoding/base64"
"net/http"
"strings"
)
// BasicAuth Middleware with next handler in chain
type BasicAuth struct {
You can’t perform that action at this time.