Skip to content

Instantly share code, notes, and snippets.

@MikeInnes
MikeInnes / startup.jl
Last active Jul 22, 2019
Some useful macros for Julia
View startup.jl
# Repeat an operation n times, e.g.
# @dotimes 100 println("hi")
macro dotimes(n, body)
quote
for i = 1:$(esc(n))
$(esc(body))
end
end
end
@sibelius
sibelius / FormUseFormik.tsx
Last active Jul 22, 2019
Example showing how to useFormik and FormikProvider
View FormUseFormik.tsx
type Props = {
};
const FormUseFormik = (props: Props) => {
const { enqueueSnackbar } = useSnackbar();
const onSubmit = (values) => {
enqueueSnackbar(`submit: ${JSON.stringify(values)}`, {
preventDuplicate: true,
persist: false,
});
@jcavat
jcavat / Dockerfile
Last active Jul 22, 2019
docker-compose with php/mysql/phpmyadmin/apache
View Dockerfile
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
View set_search_path.rb
class SetSearchPath
def initialize(app, rom)
@app = app
@connection = rom.gateways[:default].connection
end
def call(env)
@connection.synchronize do
@connection.execute("set seatch_path to #{env['tenant.schema_name']}")
@app.call(env)
@ngs
ngs / table.mkdn
Created May 24, 2012
Unicode character table
View table.mkdn

A

Description Entity Preview
A With Acute, Latin Capital Letter Á Á
A With Acute, Latin Small Letter á á
A With Breve, Latin Small Letter ă ă
A With Caron, Latin Small Letter ǎ ǎ
A With Circumflex, Latin Capital Letter  Â
A With Circumflex, Latin Small Letter â â
@JacobAae
JacobAae / geb3.groovy
Last active Jul 22, 2019
Geb 3.0 standalone script in groovy (2.5.6)
View geb3.groovy
@Grapes([
@Grab("org.gebish:geb-core:3.0"),
@Grab('io.github.bonigarcia:webdrivermanager:3.4.0'),
@Grab('org.seleniumhq.selenium:selenium-chrome-driver:3.141.0'),
])
import io.github.bonigarcia.wdm.WebDriverManager
import org.openqa.selenium.chrome.ChromeDriver
WebDriverManager.chromedriver().setup()
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
View yardoc_cheatsheet.md

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

# Namespace for classes and modules that handle serving documentation over HTTP
View commit-message-guidelines.md

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@technion
technion / Password References.md
Last active Jul 22, 2019
A set of references on modern password policies
View Password References.md

References on modern password policies

Below links provide source, reference link and relevant quote

Standards

NIST

https://github.com/usnistgov/800-63-3/blob/nist-pages/sp800-63b/sec5_authenticators.md

Verifiers SHOULD NOT impose other composition rules (e.g., requiring mixtures of different character types or prohibiting consecutively repeated characters) for memorized secrets. Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically).However, verifiers SHALL force a change if there is evidence of compromise of the authenticator.

Major organisations

You can’t perform that action at this time.