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
<!-- using semantic ui to display flags --> | |
<div class="field"> | |
<label>Country</label> | |
<div class="ui fluid search selection dropdown"> | |
<input type="hidden" name="country" value=""> | |
<i class="dropdown icon"></i> | |
<div class="default text">Select Country</div> | |
<div class="menu"> | |
<div class="item" data-value="64"><i class="nz flag"></i>New Zealand (+64)</div> | |
<div class="item" data-value="61"><i class="au flag"></i>Australia (+61)</div> |
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
// First we want to detect if the URL is valid | |
if (window.location.href.search("quizizz.com/join/game/") == -1 && window.location.href.search("gameType=") == -1) { | |
throw new Error("You aren't on a quizizz quiz. If you think this is an error please DM East_Arctica#9238 on discord!"); | |
} | |
if (typeof jQuery == 'undefined') { | |
let script = document.createElement('script'); | |
script.src = 'https://code.jquery.com/jquery-3.4.1.min.js'; | |
script.type = 'text/javascript'; | |
document.getElementsByTagName('head')[0].appendChild(script); |
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 | |
$whitelist = array('127.0.0.1','::1'); | |
if(!in_array($_SERVER['REMOTE_ADDR'], $whitelist)){ | |
echo 'Not Whitelisted<br/>'.$_SERVER['REMOTE_ADDR']; | |
}else{ | |
echo 'Whitelisted<br/>'.$_SERVER['REMOTE_ADDR']; | |
} | |
?> |
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> | |
<title> Pagination </title> | |
</head> | |
<body> | |
<?php | |
//database connection | |
$conn = mysqli_connect('localhost', 'root', '', 'db_name'); |
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 | |
$conn = mysqli_connect('localhost', 'root', '', 'db_name'); | |
$row = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM table_name")); | |
if(!$conn){ | |
echo 'Nope, dead.'; | |
}else{ | |
$myfile = fopen("filename.txt", "w+"); | |
$txt = strval($row['index']); | |
fwrite($myfile, $txt); | |
fclose($myfile); |
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
#Start a server with: python -m pyftpdlib -p 21 -w --user="some_username" --password="some_password" | |
#Works for python3.x, didn't test for python2.x | |
import ftplib #Built-in library | |
session = ftplib.FTP('127.0.0.1', 'some_username' ,'some_password') | |
file = open('<filename with extension>','rb') # file to send | |
session.storbinary('STOR <recieved file name with extension>', file) # send the file | |
file.close() # close file and FTP |
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
$(function () { | |
$(window).on('scroll', function () { | |
if ( $(window).scrollTop() > 10 ) { | |
$('.navbar').addClass('active'); | |
} else { | |
$('.navbar').removeClass('active'); | |
} | |
}); | |
}); |
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
function runExternal(){ | |
var execFile = require('child_process').execFile, child; | |
//The `process.cwd()` //Gets the current working directory. | |
//Just writing the name of the exe file and being in the same directory does not work! | |
child = execFile(process.cwd()+'nameofexe.exe', function(error,stdout,stderr) { | |
if (error) { | |
console.log(error.stack); | |
console.log('Error code: '+ error.code); | |
console.log('Signal received: '+ error.signal); | |
}else{ |
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 script will create a file with the name and extenstion provided in the parameters. | |
# Not very useful but the simplest example I could think of | |
import os, sys | |
path = os.getcwd()+"\\custom_path\\"+sys.argv[1] # I needed a custom path, you can omit that part. You still need the absolute path. | |
open(path,'w+') #Works like a native charm! | |
print("Done") #You will get this in the STDOUT on your Node 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
<!doctype html> | |
<head> | |
<style> | |
/* CSS comes here */ | |
#video { | |
border: 1px solid black; | |
width: 320px; | |
height: 240px; | |
} |
OlderNewer