Skip to content

Instantly share code, notes, and snippets.

@anestv
anestv / QA search
Created July 30, 2014 18:57
QA search for github.com/anestv/pa
@anestv
anestv / find friendships
Last active January 11, 2019 21:52
User friend of owner or owner friend of user
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
@anestv
anestv / UIparallax.html
Created October 19, 2014 12:54
Parallax scrolling for Semantic UI
<html>
<head>
<style>
/* user styles */
body {
max-width: 900px;
margin: auto;
padding: 1em;
}
@anestv
anestv / Friends.php
Created October 27, 2014 19:49
PrivateAsk MVC class header example
<?php
class Friend /* extends Model */ {
public static function addFriend($user, $friend);
public static function removeFriend($user, $friend);
public static function setFriends($user, $friendList);
@anestv
anestv / numlock.sh
Created January 1, 2016 21:07
Automatically enable numlock on login screen
#!/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..."