Skip to content

Instantly share code, notes, and snippets.

//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@thomasdarimont
thomasdarimont / ProxyProblemExample.java
Last active May 28, 2023 20:43
Hack for allowing dedicated proxy settings to be used for URL with http and https protocol handling in JavaFXs Webkit based WebView. Tested with JDK8
package de.tutorials.training.fx.proxy;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import java.net.InetSocketAddress;
@ppo
ppo / regex-ecma-262-5_1.txt
Last active September 10, 2024 15:36
Validation Regex ECMA-262 5.1 (date and/or time with optional timezone)
Format: YYYY-MM-DDTHH:mm:ss.sssZ
Date: ^\d{4}(-\d{2}){0,2}$
Time: ^\d{2}(:\d{2}(:\d{2}(\.\d+)?)?)?$
Time with optional timezone: ^\d{2}(:\d{2}(:\d{2}(\.\d+)?)?)?(Z|[\+|-]\d{2}:\d{2})?$
Date and/or time with optional timezone:
(^\d{4}(-\d{2}){0,2})?((^|T)\d{2}(:\d{2}(:\d{2}(\.\d+)?)?)?(Z|[\+|-]\d{2}:\d{2})?)?$
@justincjahn
justincjahn / README.md
Last active January 16, 2024 20:15
Minecraft server(s) using systemd and screen.

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances

sudo su --shell /bin/bash minecraft

@mohanraj-r
mohanraj-r / scp-speed-test.sh
Last active August 10, 2024 13:59
[speed test] Test ssh connection speed
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# http://www.alecjacobson.com/weblog/?p=635
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]
@enisozgen
enisozgen / is_command_exist.yml
Last active May 8, 2024 02:47
ansible tasks that Checks if a program exists from a Bash script
- name: Check is rvm installed
shell: command -v rvm >/dev/null 2>&1
register: is_rvm_exist
ignore_errors: yes
- debug: msg="{{ is_rvm_exist.rc }}" # it returns rc 1
- debug: var=is_rvm_exist
- name: Check is ls installed
shell: command -v ls >/dev/null 2>&1
@carceneaux
carceneaux / remove_gitlab_artifacts.sh
Last active March 29, 2025 22:48
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: [email protected]
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#
@amake
amake / innosetup-linux-macos.org
Last active April 7, 2025 08:35
Inno Setup on Linux and macOS

Inno Setup on Linux and macOS

Inno Setup is a popular installer builder for Windows. Of course it is made to run on Windows only, by default. But what if you want to build Windows installers off Windows, i.e. on Linux or macOS?

You’re in luck: It’s possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

@ThEMarD
ThEMarD / Update Ubuntu's platform-tools package manually.txt
Last active November 3, 2023 20:09
Update Ubuntu's platform-tools package manually
If you've installed adb and fastboot via apt install on Ubuntu and realize they're old versions, then here is how to manually update them.
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip \platform-tools-latest-linux.zip
sudo cp platform-tools/adb /usr/lib/android-sdk/platform-tools/
sudo cp platform-tools/fastboot /usr/lib/android-sdk/platform-tools/
check that it worked with:
adb --version