This file contains hidden or 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
# example: ./xcreep.sh somefile.txt | |
if [ $# -ne 1 ] | |
then | |
echo "usage: $0 <INPUTFILE>" | |
exit 1 | |
fi | |
INPUTFILE=$1 | |
cat $INPUTFILE | xclip -selection c |
This file contains hidden or 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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <linux/if_packet.h> | |
#include <net/ethernet.h> | |
#include <netdb.h> | |
#include <ifaddrs.h> | |
#include <arpa/inet.h> | |
#include <errno.h> |
This file contains hidden or 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 socket | |
import optparse | |
def createParser(): | |
# Create command line parser | |
parser = optparse.OptionParser('usage prog -H <target host> -p ' + \ | |
'<target port>') | |
parser.add_option('-H', dest='tgtHost', type='string',\ |
This file contains hidden or 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 gameFinished() { | |
// check rows | |
for (i = 1; i < 4; i++) | |
if (document.getElementById('div_'+i+'1').innerHTML == document.getElementById('div_'+i+'2').innerHTML && | |
document.getElementById('div_'+i+'2').innerHTML == document.getElementById('div_'+i+'2').innerHTML) | |
return document.getElementById('div_'+i+'1').innerHTML; | |
// check cols | |
for (i = 1; i < 4; i++) | |
if (document.getElementById('div_1'+i).innerHTML == document.getElementById('div_2'+i).innerHTML && |
This file contains hidden or 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> | |
<script type="text/javascript"> | |
let ex = true; | |
let oh = false; | |
function gameFinished() { | |
return null; | |
// dunno what to put here yet | |
} |
This file contains hidden or 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
<script type="text/javascript"> | |
let ex = true; | |
let oh = false; | |
function computePlay(buttonId) { | |
let divId = "div_"+buttonId; | |
let playSymbol; | |
if (ex) { | |
playSymbol = 'X'; | |
} else if (oh) { |
This file contains hidden or 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> | |
<script type="text/javascript"> | |
function computePlay(buttonId) { | |
let divId = "div_"+buttonId; | |
document.getElementById(divId).innerHTML = 'X' | |
//selected.style.display = 'none'; | |
} | |
</script> | |
<h1> Tic-tac-toe </h1> |
This file contains hidden or 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> | |
<script type="text/javascript"> | |
function computePlay(buttonId) { | |
let selected = document.getElementById(buttonId); | |
selected.style.display = 'none'; | |
} | |
</script> | |
<h1> Tic-tac-toe </h1> | |
<form id='board'> |
This file contains hidden or 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> | |
<script type="text/javascript"> | |
function getSelectedButton(form, name) { | |
let radios = form.elements[name]; | |
for (button in radios) { | |
if (radios[button].checked) { | |
return radios[button]; | |
} | |
} |
This file contains hidden or 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> | |
<script type="text/javascript"> | |
function getSelectedButton(form, name) { | |
let radios = form.elements[name]; | |
for (button in radios) { | |
if (button.checked) { | |
return button; | |
} | |
} | |
} |