This commit is contained in:
Morgan Bazalgette
2017-01-14 18:42:10 +01:00
parent 41ee4c90b3
commit 3961e310b1
444 changed files with 179208 additions and 0 deletions

21
vendor/zxq.co/ripple/ocl/LICENSE vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Morgan Bazalgette
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

1
vendor/zxq.co/ripple/ocl/README.md vendored Normal file
View File

@@ -0,0 +1 @@
# ocl [![GoDoc](https://godoc.org/git.zxq.co/ripple/ocl?status.svg)](https://godoc.org/git.zxq.co/ripple/ocl) [![Go Report Card](https://goreportcard.com/badge/git.zxq.co/ripple/ocl)](https://goreportcard.com/report/git.zxq.co/ripple/ocl)

53
vendor/zxq.co/ripple/ocl/level.go vendored Normal file
View File

@@ -0,0 +1,53 @@
// Package ocl allows you to do calculation of osu! levels in Go.
package ocl
import "math"
// GetLevel calculates what's the level of a score. It will stop at the
// level 10,000, after which it will give up. If you want to calculate the
// level without brakes of any kind, use GetLevelWithMax(score, -1).
func GetLevel(score int64) int {
return GetLevelWithMax(score, 10000)
}
// GetLevelWithMax calculates what's the level of a score, having a maximum
// level. Set brake to a negative number to free yourself from any brakes.
func GetLevelWithMax(score int64, brake int) int {
i := 1
for {
if brake > 0 && i >= brake {
return i
}
lScore := GetRequiredScoreForLevel(i)
if score < lScore {
return i - 1
}
i++
}
}
// GetRequiredScoreForLevel retrieves the score required to reach a certain
// level.
func GetRequiredScoreForLevel(level int) int64 {
if level <= 100 {
if level > 1 {
return int64(math.Floor(float64(5000)/3*(4*math.Pow(float64(level), 3)-3*math.Pow(float64(level), 2)-float64(level)) + math.Floor(1.25*math.Pow(1.8, float64(level)-60))))
}
return 1
}
return 26931190829 + 100000000000*int64(level-100)
}
// GetLevelPrecise gets a precise level, meaning that decimal digits are
// included. There isn't any maximum level.
func GetLevelPrecise(score int64) float64 {
baseLevel := GetLevelWithMax(score, -1)
baseLevelScore := GetRequiredScoreForLevel(baseLevel)
scoreProgress := score - baseLevelScore
scoreLevelDifference := GetRequiredScoreForLevel(baseLevel+1) - baseLevelScore
res := float64(scoreProgress)/float64(scoreLevelDifference) + float64(baseLevel)
if math.IsInf(res, 0) || math.IsNaN(res) {
return 0
}
return res
}

18
vendor/zxq.co/ripple/schiavolib/LICENSE vendored Normal file
View File

@@ -0,0 +1,18 @@
Copyright (c) 2016 Morgan Bazalgette
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,3 @@
# schiavolib
A lightweight library for Schiavo.

View File

@@ -0,0 +1,61 @@
package schiavo
import (
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"strconv"
)
// Channels to which a message can be sent.
const (
General Channel = "general"
Bunker Channel = "bunk"
ChatLog Channel = "chatlog"
Staff Channel = "staff"
CMs Channel = "cm"
)
// Channel is just a channel on the discord to which you can send messages.
type Channel string
// SchiavoURL is the base URL for schiavo. Change to var when not hardcoded
var SchiavoURL = ""
// Prefix is a prefix that will be appended to all Schiavo messages if set.
var Prefix = ""
// ForceDo is a meme
var ForceDo bool
var shouldDo = os.Getenv("GIN_MODE") == "release" || os.Getenv("SCHIAVO_LOG") != ""
// Send sends a message to a channel.
func (c Channel) Send(m string) error {
if !shouldDo && !ForceDo {
return nil
}
if SchiavoURL == "" {
return nil
}
if Prefix != "" {
m = fmt.Sprintf("**%s** %s", Prefix, m)
}
urgay := SchiavoURL + "/" + string(c) + "?message=" + url.QueryEscape(m)
resp, err := http.Get(urgay)
if err != nil {
return err
}
body, err := ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
return err
}
if string(body) != "ok" {
return errors.New("Schiavo response not ok: " + string(body) + "; status code: " + strconv.Itoa(resp.StatusCode))
}
return nil
}

View File

@@ -0,0 +1,18 @@
Copyright (c) 2016 Morgan Bazalgette
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1 @@
https://godoc.org/git.zxq.co/ripple/semantic-icons-ugc

View File

@@ -0,0 +1,5 @@
// Package semanticiconsugc provides semantic UI icons that are deemed to be safe to be accepted
// from user generated content.
package semanticiconsugc
//go:generate go run generate.go

View File

@@ -0,0 +1,109 @@
// +build ignore
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/aymerick/douceur/parser"
"os"
)
const fileHeader = `// THIS FILE WAS AUTOMATICALLY GENERATED BY A TOOL
// Use ` + "`go generate`" + ` to generate this.
package semanticiconsugc
// SaneIcons are the icons that are deemed to be safe to be accepted from user
// generated content.
var SaneIcons = []string{
`
func main() {
resp, err := http.Get("https://raw.githubusercontent.com/Semantic-Org/Semantic-UI/master/dist/components/icon.css")
if err != nil {
panic(err)
}
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
s := strings.Replace(string(b), "-webkit-", "", -1)
data, err := parser.Parse(s)
if err != nil {
panic(err)
}
f, err := os.Create("sane.go")
defer f.Close()
if err != nil {
panic(err)
}
f.WriteString(fileHeader)
blacklist := [...]string{
"icons",
"icon:first-child",
"\\35 00px", // seems like a semantic bug
"fitted",
"hover",
"active",
"emphasized",
"icons",
"link",
"circular",
"bordered",
"miny",
"tiny",
"small",
"large",
"big",
"huge",
"massive",
"corner",
}
written := make([]string, 0, 500)
// four nested for-ranges! jesus h. christ!
for _, r := range data.Rules {
if r == nil {
continue
}
for _, s := range r.Selectors {
s = strings.TrimPrefix(s, "i.")
s = strings.TrimSuffix(s, ":before")
s = strings.TrimSuffix(s, ".icon")
if s == "" {
continue
}
classes := strings.Split(s, ".")
for _, p := range classes {
var b bool
for _, bi := range blacklist {
if bi == p {
b = true
break
}
}
if b {
break
}
for _, w := range written {
if w == p {
b = true
break
}
}
if b {
continue
}
written = append(written, p)
fmt.Fprintf(f, "\t%q,\n", p)
}
}
}
f.WriteString("}\n")
}

View File

@@ -0,0 +1,703 @@
// THIS FILE WAS AUTOMATICALLY GENERATED BY A TOOL
// Use `go generate` to generate this.
package semanticiconsugc
// SaneIcons are the icons that are deemed to be safe to be accepted from user
// generated content.
var SaneIcons = []string{
"icon",
"loading",
"disabled",
"flipped",
"horizontally",
"vertically",
"rotated",
"right",
"clockwise",
"left",
"counterclockwise",
"inverted",
"red",
"orange",
"yellow",
"olive",
"green",
"teal",
"blue",
"violet",
"purple",
"pink",
"brown",
"grey",
"black",
"mini",
"icons ",
"search",
"mail",
"outline",
"signal",
"setting",
"home",
"inbox",
"browser",
"tag",
"tags",
"image",
"calendar",
"comment",
"shop",
"comments",
"external",
"privacy",
"settings",
"trophy",
"payment",
"feed",
"alarm",
"tasks",
"cloud",
"lab",
"dashboard",
"sitemap",
"idea",
"terminal",
"code",
"protect",
"ticket",
"square",
"bug",
"history",
"options",
"text",
"telephone",
"find",
"wifi",
"mute",
"copyright",
"at",
"eyedropper",
"paint",
"brush",
"heartbeat",
"mouse",
"pointer",
"hourglass",
"empty",
"start",
"half",
"end",
"full",
"hand",
"trademark",
"registered",
"creative",
"commons",
"add",
"to",
"remove",
"from",
"delete",
"checked",
"industry",
"shopping",
"bag",
"basket",
"hashtag",
"percent",
"wait",
"download",
"repeat",
"refresh",
"lock",
"bookmark",
"print",
"write",
"adjust",
"theme",
"edit",
"share",
"ban",
"forward",
"expand",
"compress",
"unhide",
"hide",
"random",
"retweet",
"sign",
"out",
"pin",
"in",
"upload",
"call",
"unlock",
"configure",
"filter",
"wizard",
"undo",
"exchange",
"reply",
"all",
"erase",
"alternate",
"archive",
"translate",
"recycle",
"send",
"cart",
"user",
"object",
"group",
"ungroup",
"clone",
"talk",
"help",
"circle",
"info",
"warning",
"announcement",
"birthday",
"users",
"doctor",
"handicap",
"student",
"child",
"spy",
"female",
"male",
"woman",
"man",
"non",
"binary",
"transgender",
"intergender",
"lesbian",
"gay",
"heterosexual",
"other",
"gender",
"vertical",
"horizontal",
"neuter",
"genderless",
"universal",
"access",
"wheelchair",
"blind",
"audio",
"description",
"volume",
"control",
"phone",
"braille",
"asl",
"assistive",
"listening",
"systems",
"deafness",
"language",
"low",
"vision",
"block",
"layout",
"grid",
"list",
"zoom",
"resize",
"maximize",
"crop",
"cocktail",
"road",
"flag",
"book",
"gift",
"leaf",
"fire",
"plane",
"magnet",
"lemon",
"world",
"travel",
"shipping",
"money",
"legal",
"lightning",
"umbrella",
"treatment",
"suitcase",
"bar",
"checkered",
"puzzle",
"extinguisher",
"rocket",
"anchor",
"bullseye",
"sun",
"moon",
"fax",
"life",
"ring",
"bomb",
"soccer",
"calculator",
"diamond",
"sticky",
"note",
"law",
"peace",
"rock",
"paper",
"scissors",
"lizard",
"spock",
"tv",
"crosshairs",
"asterisk",
"certificate",
"quote",
"spinner",
"ellipsis",
"cube",
"cubes",
"notched",
"thin",
"checkmark",
"box",
"move",
"minus",
"check",
"plus",
"radio",
"selected",
"toggle",
"off",
"on",
"film",
"sound",
"photo",
"chart",
"camera",
"retro",
"newspaper",
"area",
"pie",
"line",
"arrow",
"down",
"up",
"chevron",
"pointing",
"caret",
"angle",
"double",
"long",
"tablet",
"mobile",
"battery",
"high",
"medium",
"power",
"trash",
"disk",
"desktop",
"laptop",
"game",
"keyboard",
"plug",
"file",
"folder",
"open",
"level",
"pdf",
"word",
"excel",
"powerpoint",
"video",
"qrcode",
"barcode",
"rss",
"fork",
"html5",
"css3",
"openid",
"database",
"server",
"usb",
"bluetooth",
"alternative",
"heart",
"star",
"thumbs",
"smile",
"frown",
"meh",
"music",
"play",
"record",
"step",
"backward",
"fast",
"pause",
"stop",
"eject",
"unmute",
"closed",
"captioning",
"marker",
"coffee",
"food",
"building",
"hospital",
"emergency",
"first",
"aid",
"military",
"h",
"location",
"compass",
"space",
"shuttle",
"university",
"paw",
"spoon",
"car",
"taxi",
"tree",
"bicycle",
"bus",
"ship",
"motorcycle",
"street",
"view",
"hotel",
"train",
"subway",
"map",
"signs",
"table",
"columns",
"sort",
"descending",
"ascending",
"alphabet",
"content",
"numeric",
"font",
"bold",
"italic",
"height",
"width",
"align",
"center",
"justify",
"outdent",
"indent",
"linkify",
"cut",
"copy",
"attach",
"save",
"unordered",
"ordered",
"strikethrough",
"underline",
"paste",
"unlinkify",
"superscript",
"subscript",
"header",
"paragraph",
"cursor",
"euro",
"pound",
"dollar",
"rupee",
"yen",
"ruble",
"won",
"bitcoin",
"lira",
"shekel",
"paypal",
"google",
"wallet",
"visa",
"mastercard",
"discover",
"american",
"express",
"card",
"stripe",
"japan",
"credit",
"bureau",
"diners",
"club",
"twitter",
"facebook",
"linkedin",
"github",
"f",
"pinterest",
"maxcdn",
"youtube",
"xing",
"dropbox",
"stack",
"overflow",
"instagram",
"flickr",
"adn",
"bitbucket",
"tumblr",
"apple",
"windows",
"android",
"linux",
"dribble",
"skype",
"foursquare",
"trello",
"gittip",
"vk",
"weibo",
"renren",
"pagelines",
"vimeo",
"slack",
"wordpress",
"yahoo",
"reddit",
"stumbleupon",
"delicious",
"digg",
"pied",
"piper",
"drupal",
"joomla",
"behance",
"steam",
"spotify",
"deviantart",
"soundcloud",
"vine",
"codepen",
"jsfiddle",
"rebel",
"empire",
"git",
"hacker",
"news",
"tencent",
"qq",
"wechat",
"slideshare",
"twitch",
"yelp",
"lastfm",
"ioxhost",
"angellist",
"meanpath",
"buysellads",
"connectdevelop",
"dashcube",
"forumbee",
"leanpub",
"sellsy",
"shirtsinbulk",
"simplybuilt",
"skyatlas",
"whatsapp",
"viacoin",
"y",
"combinator",
"optinmonster",
"opencart",
"expeditedssl",
"gg",
"tripadvisor",
"odnoklassniki",
"pocket",
"wikipedia",
"safari",
"chrome",
"firefox",
"opera",
"internet",
"explorer",
"contao",
"amazon",
"houzz",
"tie",
"fonticons",
"alien",
"microsoft",
"edge",
"codiepie",
"modx",
"fort",
"awesome",
"product",
"hunt",
"mixcloud",
"scribd",
"gitlab",
"wpbeginner",
"wpforms",
"envira",
"gallery",
"glide",
"g",
"viadeo",
"snapchat",
"ghost",
"hat",
"order",
"yoast",
"themeisle",
"like",
"favorite",
"close",
"cancel",
"x",
"magnify",
"shutdown",
"clock",
"time",
"headphone",
"picture",
"pencil",
"compose",
"point",
"tint",
"signup",
"question",
"dont",
"minimize",
"exclamation",
"attention",
"eye",
"triangle",
"shuffle",
"chat",
"graph",
"key",
"cogs",
"discussions",
"dislike",
"log",
"thumb",
"tack",
"winner",
"hdd",
"bullhorn",
"bell",
"globe",
"wrench",
"briefcase",
"chain",
"flask",
"sidebar",
"bars",
"ul",
"ol",
"numbered",
"magic",
"truck",
"currency",
"dropdown",
"envelope",
"conversation",
"rain",
"clipboard",
"lightbulb",
"ambulance",
"medkit",
"fighter",
"jet",
"beer",
"computer",
"gamepad",
"broken",
"eraser",
"microphone",
"slash",
"shield",
"target",
"eur",
"gbp",
"usd",
"inr",
"cny",
"rmb",
"jpy",
"rouble",
"rub",
"krw",
"btc",
"gratipay",
"zip",
"dot",
"try",
"graduation",
"sliders",
"weixin",
"tty",
"teletype",
"binoculars",
"cord",
"wi-fi",
"amex",
"cc",
"sheqel",
"ils",
"detective",
"venus",
"mars",
"mercury",
"intersex",
"homosexual",
"stroke",
"asexual",
"official",
"times",
"bed",
"yc",
"ycombinator",
"four",
"three",
"quarters",
"two",
"one",
"quarter",
"zero",
"i",
"jcb",
"balance",
"grab",
"victory",
"tm",
"r",
"television",
"five",
"hundred",
"pixels",
"factory",
"commenting",
"ms",
"beginner",
"forms",
"devices",
"als",
"ald",
"interpreting",
"deaf",
"hard",
"of",
"hearing",
"signing",
"new",
"isle",
"fa",
}