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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
margin: 60px; | |
} |
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 | |
test |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
cmd="sudo varnishadm -T 127.0.0.1:6082 -S /etc/varnish/secret" | |
site=$(echo $1 | sed -r 's|https?://||;s|/(.*)||;') | |
page=$(echo $1 | awk -F'/' -v OFS='/' '{sub(/https?:\/\//, ""); $1=""; print $0}') | |
if [ -z "$1" ]; then | |
echo "ERROR: please provide a URL to purge.." | |
echo "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 | |
# Usage: mysql-view-definer-change.sh MYSQLDUMP.sql | |
sed -i 's/DEFINER=[^*]*\*/\*/g' $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
update oxuser set oxpassword = MD5( CONCAT( 'pass', UNHEX( oxpasssalt ) ) ) where oxusername='myusername'; |
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
git config branch.master.remote origin | |
git config branch.master.merge refs/heads/master |
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
# Test SSL connections in terminal (like telnetting into port 80) | |
openssl s_client -connect 192.168.0.1:443 |
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
/* /website/static/js/editmode/wysiwyg.js */ | |
CKEDITOR.stylesSet.add( 'custom_styles', [ | |
// Paragraph Styles | |
{ name: 'Regular Text', element: 'p', attributes: { 'class': '' }}, | |
{ name: 'Large Text', element: 'p', attributes: { 'class': 'content__text-L' } } | |
]); | |
CKEDITOR.editorConfig = function( config ) { | |
// add our custom styles |
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
SELECT | |
voteId, | |
this_num_votes, | |
this_stars, | |
( ( avg_num_votes * avg_stars ) + ( this_num_votes * this_stars ) ) / ( | |
avg_num_votes + this_num_votes ) AS real_stars | |
FROM ( | |
SELECT | |
voteId, | |
(SELECT COUNT(productId) FROM Vote) / (SELECT COUNT(DISTINCT voteId) FROM Vote) AS avg_num_votes, |