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 * FROM questions WHERE | |
MATCH(question, answer) AGAINST ('$escapedQuery') AND | |
answer IS NOT NULL AND | |
fromuser LIKE '$fromuseresc%' AND | |
touser LIKE '$touseresc%' AND | |
touser IN (SELECT username FROM users WHERE deleteon IS NULL) AND | |
timeanswered BETWEEN '$dateFormatted' AND --an exei dwsei hmeromhnia | |
'$dateFormatted' + INTERVAL 1 MONTH - INTERVAL 1 DAY AND | |
publicask = 1; --an $fromuser !== $user |
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 | |
EXISTS (SELECT friend FROM friends WHERE `user` = '$owner' AND friend = '$user') AS ou, --Owner has User | |
EXISTS (SELECT friend FROM friends WHERE `user` = '$user' AND friend = '$owner') AS uo; --User has Owner |
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
<html> | |
<head> | |
<style> | |
/* user styles */ | |
body { | |
max-width: 900px; | |
margin: auto; | |
padding: 1em; | |
} |
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 | |
class Friend /* extends Model */ { | |
public static function addFriend($user, $friend); | |
public static function removeFriend($user, $friend); | |
public static function setFriends($user, $friendList); | |
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 | |
# script to automatically enable numlock on login screen | |
# tested on Ubuntu 14.04 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
echo "Updating reps..." |