start new:
tmux
start new with session name:
tmux new -s myname
# Use this validator like this | |
# | |
# class User < ApplicationRecord | |
# validates :profile_link, url: true | |
# end | |
class UrlValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
unless valid_url?(value) | |
record.errors.add(attribute, :invalid_url) |
#!/bin/bash | |
### ABOUT | |
### Runs rsync, retrying on errors up to a maximum number of tries. | |
### Simply edit the rsync line in the script to whatever parameters you need. | |
# Trap interrupts and exit instead of continuing the loop | |
trap "echo Exited!; exit;" SIGINT SIGTERM | |
MAX_RETRIES=50 |
<?php | |
/** | |
* Twitter timeline backup | |
* | |
* Required: | |
* - PHP 8.1+ | |
* - cURL extension enabled | |
* - Windows: | |
* - download https://windows.php.net/downloads/releases/php-8.1.12-Win32-vs16-x64.zip (or a newer available version) | |
* - unzip to a folder of your choice |
#WRT Firmware Link Collections
It turns out that some kind hearted people already set up wildcard domains for you already. You can use any domain below and/or any subdomain of these and they currently resolve to 127.0.0.1 but could switch at any time to resolve somewhere else. Here's the list of ones I know about. Let me know if there are more!
localhost
- It will always works. Do you know why? I hope so.[*.]fuf.me
- Managed by @fidian; it will always point to localhost for IPv4 and IPv6[*.]fbi.com
- 👏 👏 👏 👏 👏[*.]localtest.me
[*.]127-0-0-1.org.uk
[*.]vcap.me
import { execSync, spawn, SpawnOptions } from 'child_process' | |
type XCodebuildOptions = { | |
/** | |
* Build the project specified by projectname. | |
* Required if there are multiple project files in the same directory. | |
*/ | |
project: string, | |
/** |
%w(⠾ ⠷ ⠯ ⠟ ⠻ ⠽).cycle { |dot| print "\b#{dot}"; sleep 0.1 } |
# proxying through apache to a local rails instance, http & https | |
# apache *.conf file | |
<VirtualHost *:80> | |
ServerName psl.localhost | |
ServerAlias cms.psl.localhost | |
ServerAlias *.psl.localhost | |
ProxyPass / http://localhost:3000/ | |
ProxyPassReverse / http://localhost:3000/ |