<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |
type TestCallBack struct { | |
} | |
func (c *TestCallBack) Exec(o *Observable) { | |
log.Println(o.Name) | |
} | |
type Callback interface { | |
Exec(h *Observable) |
import codecs | |
#處理編碼的套件 | |
import operator | |
##處理字典檔排序的套件 | |
cutlist = "<>/::;;,、"’,.。!?「\"\'\\\n\r《》“”!@#$%^&*()".decode("utf-8") | |
#text_new ="" |
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
// path/to/whatever does not exist | |
} | |
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) { | |
// path/to/whatever exists | |
} |
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/negroni" | |
"github.com/gorilla/mux" | |
"log" | |
"net/http" | |
) |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
// ES7, async/await | |
function sleep(ms = 0) { | |
return new Promise(r => setTimeout(r, ms)); | |
} | |
(async () => { | |
console.log('a'); | |
await sleep(1000); | |
console.log('b'); | |
})() |
# Assume we are in your home directory | |
cd ~/ | |
# Clone the repo from GitLab using the `--mirror` option | |
$ git clone --mirror [email protected]:mario/my-repo.git | |
# Change into newly created repo directory | |
$ cd ~/my-repo.git | |
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
EDIT from 2019: Hi folks. I wrote this gist for myself and some friends, and it seems like it's gotten posted somewhere that's generated some (ahem, heated) discussion. The whitespace was correct when it was posted, and since then GitHub changed how it formats (thank you @anzdaddy for suggesting a formatting workaround) honestly this is a random throwaway gist from 2015, and someone more knowledgable about this comparison should just write a proper blog post about it. If you comment here I'll hopefully see it and stick a link to it up here. Cheers. @oconnor663<pre>
tags. Look at the raw text if you care about this. I'm sure someone could tell me how to fix it, but
Here's the canonical TOML example from the TOML README, and a YAML version of the same.
title = "TOML Example" |