Skip to content

Instantly share code, notes, and snippets.

@kaze
kaze / selenium-install
Last active January 9, 2024 03:42 — forked from xiaol825/install.txt
How to install Chrome, ChromeDriver and Selenium on CentOS. Plus a sample scraping script.
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@kaze
kaze / core.clj
Created October 9, 2021 13:49 — forked from plexus/core.clj
(ns my-backend.core
(:gen-class)
(:require [compojure.core :as c]
[compojure.route :as route]
[ring.adapter.jetty :as jetty]
[ring.middleware.defaults :as ring-defaults]
[hiccup2.core :as h]
#_[muuntaja.core :as m]
[muuntaja.middleware :as muuntaja]))
@kaze
kaze / sbcli
Created November 22, 2020 15:54
startup file for sbcl repl
#!/usr/bin/env -S sbcl --script
(load "~/quicklisp/setup")
(let ((*standard-output* (make-broadcast-stream)))
(ql:quickload "alexandria")
(ql:quickload "cl-readline"))
(defpackage :sbcli
(:use :common-lisp :cffi)
(:export sbcli *repl-version* *repl-name* *prompt* *prompt2* *ret* *config-file*
@kaze
kaze / machine.js
Last active September 17, 2020 14:19
Generated by XState Viz: https://xstate.js.org/viz
const selector = Machine({
id: 'selector',
initial: 'inactive',
context: {
items: null,
value: null,
loaded: false,
},
states: {
inactive: {
@kaze
kaze / machine.js
Created September 14, 2020 04:52
Generated by XState Viz: https://xstate.js.org/viz
const submit_register = async data => data;
const update_service = assign((context, event) => {
return { service: event.data };
});
const update_language = assign((context, event) => {
return { language: event.data };
});
@kaze
kaze / machine.js
Last active September 14, 2020 04:51
Generated by XState Viz: https://xstate.js.org/viz
// login machine actions --------------------------------------------------- //
const submit_login = async (context) => {
if (!context.email) {
show_message('LOGIN_NO_EMAIL_ERROR', 'error');
}
if (!context.password) {
show_message('LOGIN_NO_PASSWORD_ERROR', 'error');
}
@kaze
kaze / machine.js
Last active September 14, 2020 04:45
Generated by XState Viz: https://xstate.js.org/viz
const login_activate_signal = 'login.activate';
const login_deactivate_signal = 'login.deactivate';
const register_activate_signal = 'register.activate';
const register_deactivate_signal = 'register.deactivate';
const send_activate_login = () => {
send({ type: login_activate_signal })
};
const send_deactivate_login = () => {
@kaze
kaze / machine.js
Last active September 7, 2020 13:29
Generated by XState Viz: https://xstate.js.org/viz
const resend_confirmation_machine = {
id: 'resendconfirmation',
initial: 'inactive',
states: {
inactive: {
always: '#loginform.active',
},
active: {
on: {
'resendconfirmation.email.focus': 'email',
@kaze
kaze / machine.js
Last active September 3, 2020 13:21
Generated by XState Viz: https://xstate.js.org/viz
const validate = async () => null;
// validation helpers ------------------------------------------------------ //
const should_validate = (context) => {
return (context.value &&
((context.leaving && context.validate) ||
(!context.leaving && context.validated))
)
};
@kaze
kaze / machine.js
Last active September 3, 2020 13:13
Generated by XState Viz: https://xstate.js.org/viz
const validate = async () => null;
const should_validate = (context) => {
return (context.value &&
((context.leaving && context.validate) ||
(!context.leaving && context.validated))
)
};
const check = async (context) => {