Skip to content

Instantly share code, notes, and snippets.

View krry's full-sized avatar
🐻
busybear

kerry krry

🐻
busybear
View GitHub Profile
@krry
krry / exercise-error.go
Created March 4, 2019 00:42
An Answer to A Tour of Go Exercise: Errors
package main
import (
"fmt"
"math"
)
type ErrNegSqrt float64
func (e ErrNegSqrt) Error() string {
@krry
krry / exercise-slices.go
Last active April 17, 2020 20:41
An answer to the Slices exercise in A Tour of Go
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
grid := make([][]uint8, dy)
for y := range grid {
line := make([]uint8, dx)
for x := range line {
line[x] = uint8(y-x)
@krry
krry / figlet_wiggle.sh
Last active February 22, 2019 08:25
One-line Random Figlet Font Fortune
brew install figlet coreutils # for OSX
figlet -f $(ls $(brew --prefix figlet)/share/figlet/fonts/ | grep ".flf" | shuf -n 1) "Atmanaut"
@krry
krry / kamadhenu
Last active February 11, 2019 10:53
kamadhenu - heed the wise old cow in your mac terminal
# Kamadhenu
# https://www.wikiwand.com/en/Kamadhenu
#
# the holy cow speaketh
#
# for OSX, possible to port to Linux
brew install figlet cowsay lolcat fortune
git clone https://github.com/krry/cowsay-files
@krry
krry / global-preset.css
Last active February 19, 2018 00:31
Global Preset Styles for Each and Every Web App/Page/Site
* {
/* de-pixelates light text on dark backgrounds */
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: subpixel-antialiased;
text-rendering: geometricPrecision;
/* optimizeSpeed turns kerning & ligatures off, optimizeLegibility turns them on */
/* geometricPrecision prevents browsers from rounding partial font sizes */
}
@krry
krry / path-to-arrival.css
Last active December 9, 2017 00:01
Styles for the Path to Arrival timeline on Tiki-Toki
@import url('https://fonts.googleapis.com/css?family=Montserrat');
.tl-embedded-timeline {
overflow: hidden;
width: 100%;
height: 100vh;
}
.tl-font, .tl-font-head, .tl-font-body {
font-family: "Montserrat", "Futura", "Trebuchet MS", sans-serif !important;
@krry
krry / tweet_dumper.py
Created January 23, 2017 22:45 — forked from Kaorw/History\-11bc708b\entries.json
There is no exception for error (ex. incorrect ID, Not public, etc.), please check all ID before run the code
# Grap multiple user's user_timeline from twitter API and save to Excel
# Code will be save user's tweet ID, created Time, Coordinates-x, Coordinates-y, source, text. Can be modified at line 48 and so on
# Original code from https://gist.github.com/yanofsky/5436496 "A script to download all of a user's tweets into a csv"
import xlsxwriter
import tweepy
#https://github.com/tweepy/tweepy
consumer_key = "Your_consumer_key"
/* Random Boolean */
var randomNumber = Math.random() >= 0.5;
console.log(randomNumber);
@krry
krry / .gitignore_global
Created August 1, 2014 07:18
git config --global core.excludesfile
.DS_Store
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
@krry
krry / config.json
Created July 31, 2014 01:13 — forked from anonymous/config.json
SolarCity-branded Bootstrap configuration
{
"vars": {
"@gray-darker": "#333333",
"@gray-dark": "#5f5f5f",
"@gray": "#808080",
"@gray-light": "#d9d9d9",
"@gray-lighter": "#e6e6e6",
"@brand-primary": "#008752",
"@brand-success": "#13ab4a",
"@brand-info": "#59b0e0",