// `table A` is filled with rows of data that contain a reference key to the `id` column of `table B`
// we need to rows with the most occurrences of reference keys, then return the data from the matching row in `table B`
// for instance,
// `table A` are newspapers, and `table B` are countries
// `table A` might look like
// name | key
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 init --bare | |
// cd hooks && touch post-receive && cat /dev/clipboard > post-receive && chown USER:GROUP post-receive | |
#!/bin/bash | |
# forked from | |
# https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa#file-post-receive | |
TARGET="/var/www/html/" | |
GIT_DIR="/var/www/html/REPOSITORY.git" | |
BRANCH="production" |
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
class API { | |
private $path; | |
private $length; | |
private $route; | |
private $db; | |
function __construct(array $options) { | |
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 [[$1 == "export"]] | |
then mysqldump -u $2 $3 > "$3.sql"; | |
fi | |
if [[$1 == "import"]] | |
then mysql -u $2 $3 < "$3.sql"; | |
fi | |
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 | |
//https://gist.github.com/taniarascia/013fb512078329cc6c40f4e4bf98fdbf | |
class MysqlDriver { | |
private $host; | |
private $dbname; | |
private $username; | |
private $password; | |
private $charset; | |
private $collate; |
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
#!/usr/bin | |
# https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04 | |
sudo apt install php libapache2-mod-php php-mysql | |
sudo nano /etc/apache2/mods-enabled/dir.conf | |
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 './addClass'; | |
import './removeClass'; | |
import './addAttribute'; | |
import './removeAttribute'; | |
export default var elements = (element) => { | |
return { | |
addClass: (className) => { return addClass(element, className) }, | |
removeClass: (className) => { return removeClass(element, className); }, |
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
/** | |
* This is an object | |
* where we can store methods | |
* that are accessible with a string | |
*/ | |
var conditional = { | |
humanities: () => |
Really simple form-to-xhr requests with FormData
, Request
and onclick
<form id="form">
<input id="input" name="input" placeholder="" />
<input type="submit" onclick="submitForm(event)" />
</form>
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 findX = () => event.clientX - event.target.offsetLeft; | |
var findY = () => event.target.offsetTop - event.clientY; |