Skip to content

Instantly share code, notes, and snippets.

@sytxerr
sytxerr / mysqlfix.sh
Last active June 16, 2017 08:30 — forked from mheadd/monitor.sh
Simple bash script to check whether MySQL is running, then restart if inactive
#!/bin/bash
PATH=/usr/sbin:/usr/bin:/sbin:/bin
UP=$(/etc/init.d/mysql status | grep running | grep -v not | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";
service mysql start
else
echo "All is well.";
@sytxerr
sytxerr / spintax.php
Created June 6, 2017 12:14 — forked from irazasyed/spintax.php
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
* @name Spintax
* @author Jason Davis - https://www.codedevelopr.com/
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/
*/
class Spintax
{
public function process($text)
@sytxerr
sytxerr / backup.sh
Created June 5, 2017 10:59 — forked from keithmorris/backup.sh
OSX Rsync Backup to External Drive
#!/bin/bash
src=/Users/kmorris
backupPath=/Volumes/Backups/backups
date=`date "+%Y-%m-%dT%H%M%S"`
dirname=backup_$date
excludeFile=/Users/kmorris/bin/backup-excludes.txt
rsync -aAXPlv --exclude-from=$excludeFile --link-dest=$backupPath/latest $src $backupPath/$dirname
rm -f $backupPath/latest
@sytxerr
sytxerr / remove-words.php
Created June 5, 2017 10:58 — forked from keithmorris/remove-words.php
PHP remove common words from a string
<?php
function removeCommonWords($input){
// EEEEEEK Stop words
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid','amidst','among','amongst','an','and','another','any','anybody','anyhow','anyone','anything','anyway','anyways','anywhere','apart','appear','appreciate','appropriate','are','aren\'t','around','as','a\'s','aside','ask','asking','associated','at','available','away','awfully','b','back','backward','backwards','be','became','because','become','becomes','becoming','been','before','beforehand','begin','behind','being','believe','below','beside','besides','best','better','between','beyond','both','brief','but','by','c','came','can','cannot','cant','can\'t','caption','cause','causes','certain','certainly','changes','clearly','c\'mon','co','co.','com','come','comes','concerni
<?php
http://www.bing.com/search?q='.urlencode(strtolower($termstring)).'&count=10&first=0&format=rss