Skip to content

Instantly share code, notes, and snippets.

View caseyamcl's full-sized avatar

Casey McLaughlin caseyamcl

View GitHub Profile
@lindhe
lindhe / subscribe.sh
Created December 17, 2017 12:42
Bash script to subscribe people to a mailman mailing list (at least on chs.chalmers.se)
#!/bin/bash
domain='example.com'
list='list-name'
password=''
file='./members.txt'
echo "Logging in..."
curl -v -L -X POST -j -b non-existing -c './'$list'.cookie' --data 'adminpw='$password'&admlogin=Let me in...' 'http://lists.'$domain'/mailman/admin/'$list
echo "Logged in!"
@RichardBronosky
RichardBronosky / README.MD
Last active May 19, 2024 22:03
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@dhrrgn
dhrrgn / console
Last active December 12, 2021 01:24
Adding global Options/Arguments to Symfony Console Applications
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
require 'vendor/autoload.php';
$app = new Application;
@elieandraos
elieandraos / Sluggify a string with php
Created June 19, 2013 10:09
Sluggify a string with php
/*
* Modifies a string to remove all non ASCII characters and spaces.
* Try slugify("é&asd_æô") for example
*/
function slugify($text)
{
// replace non letter or digits by -
$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
// trim
$text = trim($text, '-');
@mynameispj
mynameispj / Props
Created July 24, 2012 14:55
Estimated reading time in PHP, by Brian Cray
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/