Skip to content

Instantly share code, notes, and snippets.

View PicoCreator's full-sized avatar
🤔
hmmm...

Eugene Cheah PicoCreator

🤔
hmmm...
View GitHub Profile
@PicoCreator
PicoCreator / regex-commentry-sample.js
Created July 25, 2022 03:38
Example of regex with maintainable commantry, in JS
//
// Closing block regex, this is used to find our {% endhint %} block
//
// / # - Start of regex
// ( # - Opening capture group 1
// \{\%[\s]+ # - Match against "{% " and any number of white space
// endhint[\s]+ # - Match against "endhint " including one or more whitespace
// [.]*\%\} # - Match against "%}" including any random=properties which we ignore
// # ( Eg: "{% endhint param=xyz %}" )
// ) # - Closing capture group 1
@PicoCreator
PicoCreator / testrun-get.json
Created March 13, 2022 13:08
Example testrun result API JSON
{
"result" : {
"data" : null,
"type" : "MANUAL",
"resolution" : "1280x960",
"testRunBillID" : "EAMdDc1hSCsQJfSPoDpMi6",
"result" : {
"workspacePath" : "/workspace/8JWGHaqm1ovYYvR2G54oam/",
"errorSteps" : [ ],
"session" : {
@PicoCreator
PicoCreator / CreateYourFirstTestExample.java
Created March 7, 2022 03:34
Selenium java example, for testing uilicious page
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class CreateYourFirstTestExample {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "./exefiles/chromedriver.exe");
@PicoCreator
PicoCreator / dockerfile
Created August 4, 2021 13:09
statamic-dockerfile
#
# The following is an example dockerfile i used to build the statamic site
# to deploy in a single container, using php artisian serve
#
FROM php:8.0.9-fpm-alpine
#
# Add some required PHP "addons"
# and other addons
#
@PicoCreator
PicoCreator / blank.html
Created February 24, 2020 11:10
intentionally a blank html
We couldn’t find that file to show.
@PicoCreator
PicoCreator / prod-mode.log
Last active February 26, 2019 01:59
dev.to production mode error dump
>---
> [dev.to/docker-entrypoint.sh] DEMO mode
>
> Time to rock & roll
>---
== Installing dependencies ==
Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
https://github.com/thepracticaldev/acts_as_follower.git (at master@288690c) is
not yet checked out. Run `bundle install` first.
Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
@PicoCreator
PicoCreator / mailgun-sample-response.js
Last active September 21, 2018 03:02
mailgun-sample-response
{
...,
storage : {
url: “https://<region>.api.mailgun.net/v3/domains/<your domain>/messages/<email-key>",
key: <email-key>
},
...
}
@PicoCreator
PicoCreator / inboxkitten.test.js
Created September 20, 2018 08:37
inboxkitten test snippet
//
// Testing for empty inbox
//
// Lets goto inbox kitten
I.goTo("https://inboxkitten.com");
I.see("Open-Source Disposable Email");
// Go to a random inbox inbox
I.fill("email", SAMPLE.id(22));
@PicoCreator
PicoCreator / reddit-underscore-bug.test.js
Last active July 30, 2018 04:53
new reddit bug with underscore in URL (testing via uilicious)
//
// The following is a uilicious.com test script used to validate the bug
//
// Go to the bug reporting website
I.goTo("https://www.reddit.com/r/bugs/comments/91cp3r/bug_with_underscore_in_url/");
// Perform the assertion
I.see("https://www.instagram.com/iamashleyortiz_");
I.see("https://www.instagram.com/_Miss.Em_");
@PicoCreator
PicoCreator / promis-redis-retry-config.js
Created March 13, 2018 15:58
Using promise-redis with retry config
let redis = require("promise-redis")();
let redisClient = redis.createClient(port, host, {
retry_strategy: function (options){
if(options.error && options.error.code === "ECONNREFUSED"){
return new Error("The server refused the connection.");
}
if (options.total_retry_time > 1000 * 60 * 60) {
// End reconnecting after a specific timeout and flush all commands
// with a individual error
return new Error('Retry time exhausted');