Skip to content

Instantly share code, notes, and snippets.

View skaparate's full-sized avatar

skaparate skaparate

View GitHub Profile
@skaparate
skaparate / object-subarray.groovy
Created October 25, 2021 21:47
Fixed subarray of objects in Groovy JsonBuilder
def map = [:]
def list = []
map.put("suba", "Sub A")
map.put("subb", "Sub B")
list.add(map)
def propA = "value"
@skaparate
skaparate / launch.json
Created July 15, 2021 23:29
VSCode config for XDebug
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"log": true,
"pathMappings": {
@skaparate
skaparate / primary-delicious-cgi-1.json
Last active February 13, 2021 02:32
PrimaryDeliciousCgi child categories
[
{
"name": "Asus",
"id": 1
},
{
"name": "Toshiba",
"id": 2
},
{
@skaparate
skaparate / categories.json
Created February 13, 2021 02:27
PrimaryDeliciousCgi Parent categories
[
{
"name": "Computers"
},
{
"name": "Tablets"
},
{
"name": "Phones"
}
@skaparate
skaparate / randomString.groovy
Created December 11, 2020 14:39
Generates a random string using only letters and numbers in Groovy
// Credits: https://stackoverflow.com/a/30438121
// I use this to generate random strings in jetbrains IDEs (IntelliJ, PHPStorm, etc.).
// Modify the length of the string by replacing the 10 in 1..10
new Random().with {(1..10).collect { (('A'..'Z')+('0'..'9')+('a'..'z'))[nextInt(64) ] }.join()}
@skaparate
skaparate / json-quotes
Created April 27, 2020 23:59
Testing validity of JSON data.
{
"quotes": [
{"quote": "Suck a dick, dumbshits!", "author": "Sarah Lynn"},
{"quote": "Every day, it gets a little easier. But you gotta do it every day -- that's the hard part.", "author": "Running Babboon"},
{"quote": "When you look at someone through rose-colored glasses, all the red flags just look like flags.", "author": "Wanda"},
{"quote": "I was at the stock market today, I did a business.", "author": "Vincent Adultman"},
{"quote": "I don't think I believe in 'deep down'. I think that all you are is just the things that you do.", "author": "Diane"},
{"quote": "The key to being happy isn't the search for meaning. It's to just keep yourself busy with unimportant nonsense and eventually, you'll be dead.", "author": "Mr. PeanutButter"},
{"quote": "I'm responsible for my own happiness? I can't even be responsible for my own breakfast!", "author": "Bojack"}
]}
@skaparate
skaparate / randstr
Last active April 10, 2020 17:46
Bash script to generate random strings and/or passwords
#!/bin/bash
OPTIND=1
function usage() {
echo 'Usage: randstr OPTIONS'
echo 'Generates a random string with the specified options.'
echo 'By default, the generated string uses lower and uppercase letters, '
echo 'numbers and has a length of 8.'
echo ''
echo 'OPTIONS:'
CREATE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
CREATE (Keanu:Person {name:'Keanu Reeves', born:1964})
CREATE (Carrie:Person {name:'Carrie-Anne Moss', born:1967})
CREATE (Laurence:Person {name:'Laurence Fishburne', born:1961})
CREATE (Hugo:Person {name:'Hugo Weaving', born:1960})
CREATE (LillyW:Person {name:'Lilly Wachowski', born:1967})
CREATE (LanaW:Person {name:'Lana Wachowski', born:1965})
CREATE (JoelS:Person {name:'Joel Silver', born:1952})
CREATE
(Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrix),
#!/bin/bash
restorecon -r /etc/ssh