This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
// create custom plugin settings menu | |
add_action('admin_menu', 'my_plugin_create_menu'); | |
function my_plugin_create_menu() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.hashQuery = { | |
get: function (key) { | |
d = {}; | |
$.each(window.location.hash.slice(1).split("&"), function (b, a) { | |
a !== "" && (a.indexOf("=") !== -1 ? (a = a.split("="), d[a[0]] = a[1]) : d[a] = "") | |
}); | |
if ($.isEmptyObject(d)) { | |
return !1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checks if the given e-mail is valid | |
* Checks Done: | |
* - Email has correct number of '@' and lengths | |
* - Domain is valid | |
* - Domain has too little parts | |
* - Domain has valid parts | |
* - Domain is IP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var patterns = '.ach4 .ad4der .af1t .al3t .am5at .an5c .ang4 .ani5m .ant4 .an3te .anti5s .ar5s .ar4tie .ar4ty .as3c .as1p .as1s .aster5 .atom5 .au1d .av4i .awn4 .ba4g .ba5na .bas4e .ber4 .be5ra .be3sm .be5sto .bri2 .but4ti .cam4pe .can5c .capa5b .car5ol .ca4t .ce4la .ch4 .chill5i .ci2 .cit5r .co3e .co4r .cor5ner .de4moi .de3o .de3ra .de3ri .des4c .dictio5 .do4t .du4c .dumb5 .earth5 .eas3i .eb4 .eer4 .eg2 .el5d .el3em .enam3 .en3g .en3s .eq5ui5t .er4ri .es3 .eu3 .eye5 .fes3 .for5mer .ga2 .ge2 .gen3t4 .ge5og .gi5a .gi4b .go4r .hand5i .han5k .he2 .hero5i .hes3 .het3 .hi3b .hi3er .hon5ey .hon3o .hov5 .id4l .idol3 .im3m .im5pin .in1 .in3ci .ine2 .in2k .in3s .ir5r .is4i .ju3r .la4cy .la4m .lat5er .lath5 .le2 .leg5e .len4 .lep5 .lev1 .li4g .lig5a .li2n .li3o .li4t .mag5a5 .mal5o .man5a .mar5ti .me2 .mer3c .me5ter .mis1 .mist5i .mon3e .mo3ro .mu5ta .muta5b .ni4c .od2 .odd5 .of5te .or5ato .or3c .or1d .or3t .os3 .os4tl .oth3 .out3 .ped5al .pe5te .pe5tit .pi4e .pio5n .pi2t .pre3m .ra4c .ran4t .ratio5na .ree2 .re5mit .re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for folder in $(sudo find /Users -name ".git" -type d | sed 's#\(.*\)/.*#\1#' | sort -u); do | |
stree $folder; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# source: http://stackoverflow.com/questions/279169/deploy-a-project-using-git-push | |
name="new_project" | |
mkdir $name | |
cd $name | |
git init | |
git config receive.denyCurrentBranch ignore | |
curl https://gist.githubusercontent.com/kostasdizas/f76dad08cc3a724b0971/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update > .git/hooks/post-update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from unittest.mock import patch | |
from io import StringIO | |
import ass1 | |
def ex_run(func, inputs): | |
print("-" * 50) | |
print("running: {0} with inputs {1}".format(func.__name__, ", ".join(inputs))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z $1 ]] || [[ -z $2 ]]; then | |
echo "arguments missing" | |
exit 1 | |
fi | |
one=${1%/} | |
two=${2%/} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# led_control [on|off] : Turn the LEDs on or off | |
function display_usage() { | |
echo "Control the Raspberry Pi leds" | |
echo -e "\nUsage:\n$0 [on|off]\n" | |
exit 1 | |
} | |
[ $# -eq 0 ] && display_usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# compare calculated from file and input checksums for any hash function | |
if [ $# -lt 3 ] ; then | |
echo 'usage -- comparechecksum hashfunction filename checksum' | |
exit 1 | |
fi | |
[ $($1 $2 | cut -f 1 -d " ") == $3 ] && echo "OK: All good" || echo "NOT OK: File does not match given checksum" |
OlderNewer