Skip to content

Instantly share code, notes, and snippets.

View wmantly's full-sized avatar

William Mantly wmantly

View GitHub Profile
o.fun = function(){};
vs
function o(){
this.fun = function(){};
};
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<style type="text/css">
*{
padding: 0;
margin: 0;
}
#board{
Create it!
*
**
***
****
*****
******
*******
********
var makeTriangleConsole = function( triHeight ){
triHeight = Number( triHeight );
out = "";
console.log(triHeight)
for( var rowI = 0; rowI <= triHeight; rowI++ ){
for( var colI = 0; colI <= 5; colI++ ){
if( colI < ( triHeight - rowI) ){
out += " ";
}else{
out += "x";
Credit Card Validator
Using the Luhn Algorithm, also known as "modulus 10", we will be determining the validity of a given credit card number.
For now, we are just editing the included .js file. You will find the skeleton of the CreditCard prototype inside.
The Class
We want our class to have its three main properties set on instantiation - ccNum, cardType, and valid. If the card number given passes the Luhn algorithm, valid should be true and cardType should be set to 'VISA', 'AMEX', etc. If it does not pass, valid should be false and cardType should be set to "INVALID"
function CreditCard( ccNum ){
this.ccNum = ccNum;
this.cardType = "INVALID"
this.valid = false
this.cardType = this.validStartingNums();
if( !this.checkLength() ) return false ;
if( !this.validate() ) return false ;
}
Caesar's Cipher is named after Julius Caesar, who used it with a shift of three to protect messages of military significance.
A shift of three to the right would change the letter A to D, B to E, C to F, and so on.
A shift of three to the left would change the letter A to X, B to Y, C to Z, D to A, and so on.
Of course this offers no communication security whatsoever - except in Roman times when most people couldn't read to begin with.
But the Caesar Cipher is still used in cryptography, in addition to many other methods. So this is your first step into the world of security and data encryption.
#!/bin/bash
xpra start :80 &
sleep 5
DISPLAY=:80 ./dogecoin-qt&
sleep 1
DISPLAY=:80 ./litecoin-qt&
sleep 1
DISPLAY=:80 bitcoin-qt&
sleep 1
DISPLAY=:80 ./tacocoin-qt&
$ cat README
This is the README file.
<<<<<<< HEAD
This line was added from the 'master' branch.
=======
The 'test' branch version is here.
>>>>>>> test
One more line.
 def _handle_request(self, method, params):
        if method == 'helloWorld':
            (a, b) = params
            return a + '-' + b
        elif method == 'add':
            (a, b) = params
            return a + b
        elif method == 'statusBar':
            message, = params