This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript"> | |
var myData = Array(); //create the blank array variable | |
//now add values to the array from PHP | |
<?php |
This file contains hidden or 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 | |
include("MYSQL2JSON.class.php"); | |
//MySQL connect | |
$c = mysql_connect("useawsfordbduuuh.c345tgxpm1uqz.us-east-1.rds.amazonaws.com", "login", "password!"); | |
mysql_select_db("database"); | |
$json = new MYSQL2JSON(); //Create an object | |
$form = '<FORM | |
<form action="index.php" method="post"> | |
<label><input type="checkbox" name="col[]" value="Asphalt">Asphalt</label><br> |
This file contains hidden or 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
#!/usr/bin/env php | |
<?php | |
$app = function($request) { | |
$body = <<<EOS | |
<!DOCTYPE html> | |
<html> | |
<meta charset=utf-8> | |
<title>Hello World!</title> |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
/* | |
* Convert JSON file to CSV and output it. | |
* | |
* JSON should be an array of objects, dictionaries with simple data structure | |
* and the same keys in each object. | |
* The order of keys it took from the first element. | |
* | |
* Example: |
This file contains hidden or 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
' !x[$1]++' |
This file contains hidden or 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
*{cursor:url("//URI.to.customcursor.png"),default!important}* | |
body a,.arrow,button,a.progress,div.expando-button{cursor:url("//URI.to.customcursor.png"),!important} |
This file contains hidden or 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
ffmpeg -i $(IN) -c:v libvpx -pass 1 -an -f rawvideo -y /dev/null # Generates ffmpeg2pass-0.log | |
ffmpeg -i $(IN) -c:v libvpx -pass 2 -f webm -b:v 400K -crf 10 -an -y $(OUT).webm |
This file contains hidden or 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
String contains string | |
stringContains() { [ -z "${2##*$1*}" ] && [ -z "$1" -o -n "$2" ]; } | |
# Used like so | |
SRC_STRING="this is a sample string where TEST we want to check for the word 'TEST'" | |
if stringContains "TEST" "$SRC_STRING"; then | |
echo "Found TEST in SRC_STRING" | |
else | |
echo "Couldn't find TEST in SRC_STRING" |
This file contains hidden or 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
Testing gist command line |
This file contains hidden or 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
#RUN AS ROOT | |
# To get samba to recognize changes to its smb.conf *without restart*, as root: | |
# 1) First test your configuration file for errors: | |
testparm /path/to/smb.conf; echo $? | |
#If it exits '0' you're good to go. | |
# 2) Find the parent SMBD | |
ps -ef | grep smbd |