Skip to content

Instantly share code, notes, and snippets.

@jayjanssen
jayjanssen / gist:6b83c2c06e89c679367d8224be23cb53
Last active February 13, 2020 13:27
ServiceNow Modify TinyMCE Settings -- Client Script, onLoad, Tested on Madrid
function onLoad() {
tinymce.on('AddEditor', function(e) {
e.editor.settings.block_formats = 'Paragraph=p;Preformatted=pre;Quote=blockquote;Heading 1=h1;Heading 2=h2;Heading 3=h3;None=removeformat';
e.editor.settings.forced_root_block = false;
});
}
@jayjanssen
jayjanssen / convox.yml
Last active November 26, 2019 20:12
Shared local rack resources for Convox gen2
# NOT FOR PRODUCTION, JUST FOR LOCAL RACKS!!!!!
# I use this convox.yml to setup local gen2 rack services.
# NOT for apps that have their own resources defined, these are resources are shared across multiple apps
# In production, these are either non-convox SaaS (e.g., I use Elastic cloud for my prod elasticsearch)
# *or* I set them up with `convox resources create` (e.g., my shared redis)
# This config is just a handy way to have local dev services running that my local convox rack can use.
resources:
# Any resources here exposed locally as <resourcename>.resource.<appname>.convox
redis:
type: redis

Keybase proof

I hereby claim:

  • I am jayjanssen on github.
  • I am perconajayj (https://keybase.io/perconajayj) on keybase.
  • I have a public key ASD73ASV9xg29hDRfIRC_K8LFE6ilm4-ylbyr2C3d3moVAo

To claim this, I am signing this object:

testschedule:
build: .
command: "tail -f /dev/null"
labels:
- convox.cron.myjob=* * * * ? echo "Hello"; sleep 120; echo "slept"
- convox.cron.secondjob=[26,27,28] * * * ? echo "Hello 2"
- convox.cron.thirdjob=*/2 * * * ? echo "Hello 3"
sqs:
image: lightspeedretail/fake-sqs
environment:
- LINK_SCHEME=http
- LINK_PASSWORD=test
- LINK_USERNAME=test
- LINK_PATH=/queue/default
ports:
- 9324
@jayjanssen
jayjanssen / gist:e6b309218cc452cb8df5fc9bd78b851d
Created April 18, 2016 21:09
mysqlx with iced coffeescript
#!/usr/bin/env iced
mysqlx = require('mysqlx')
# Connect to server on localhost
await mysqlx.getSession {
host: 'mysql57.docker', port: '33060',
dbUser: 'root', dbPassword: 'root'
}
.then defer session
@jayjanssen
jayjanssen / glacier_inc.pl
Created December 24, 2015 17:17
ZFS full/incrementals to AWS Glacier
#!/usr/bin/perl
use vars qw/ @ARGV /;
local $ENV{PATH} = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
die "Usage: $0 <filesystem>\n" unless $#ARGV == 0;
my $filesystem = shift @ARGV;
my $base_snap = '@glacier';
@jayjanssen
jayjanssen / gist:8e74bc4c5bdefc880ffd
Last active March 16, 2023 02:21
Golang MySQL connection with multiple IPs and connection timeouts
package main
import (
"database/sql"
"fmt"
"github.com/go-sql-driver/mysql"
"log"
"net/http"
"strings"
"time"
@jayjanssen
jayjanssen / gist:8ee0659dc0618ba60268
Created July 15, 2015 18:42
Can I read the gcache mmap?
package main
import "github.com/riobard/go-mmap"
import "fmt"
import "os"
func main() {
file, err := os.Open( "/gcache/galera.cache")
if err != nil {
panic( err )