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 Basics | |
import Graphics.Element exposing (..) | |
import Graphics.Input.Field as Field | |
import List exposing (..) | |
import Random exposing (..) | |
import String | |
type Face = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King | Ace | Joker | |
type Suit = Diamonds | Hearts | Clubs | Spades | Brand | |
type alias Card = { suit:Suit, face:Face } |
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 Graphics.Element exposing (..) | |
import Graphics.Input.Field as Field | |
import List | |
import String | |
{-- http://www.reddit.com/r/dailyprogrammer/comments/2qxrtk/20141231_challenge_195_intermediate_math_dice/cnawmtn --} | |
{-- | |
based on https://hackage.haskell.org/package/split-0.1.1/docs/Data-List-Split.html |
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
Michael Bublé,Jason Mraz,光田康典,The National,Sarah McLachlan,Claude Debussy,Lady Gaga,周杰倫,植松伸夫,Indochine,Rise Against,City and Colour,Radiohead,Red Hot Chili Peppers,Alexisonfire,Bebo & Cigala,The Mars Volta,Chick Corea & Hiromi,Theory of a Deadman,Cantaloupe Island,Adam's Apple,A Brighter Day,Afrodisia,Mambo De La Pinta,Greg Osby,James Newton,Testify,Art Blakey,Caravan,Tsuyoshi Sekito,Mira,Temptation,A Night In Tunisia,Serj Tankian,Winter,Duke Pearson,Cantaloop (Flip Fantasia),Cæcilie Norby,El Cumbanchero,You Don't Know What Love Is,Death Letter,Art Taylor,Closer to Home,Indio Gitano,Solomon Ilori and his Afro-Drum Ensemble,Black Byrd,Far West,Hi-Heel Sneakers,Congalegra,There Is The Bomb | |
The Beatles,Chase Coy,Stephen Jerzak,nevershoutnever!,Taylor Swift,The Maine,All Time Low,Boys Like Girls,McFly,Owl City,Glee Cast,Brokencyde,Ke$ha,Relient K,Cobra Starship,Jason Mraz,Across The Universe Soundtrack,Romance On A Rocketship,Hellogoodbye,Avril Lavigne,Show Me The Skyline,Hey Monday,Sterling Knight,Kate Nash,Plai |
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 sys | |
# def xor(b, s): return "".join(map(lambda x: chr(x^b), map(lambda x: ord(x), s))) | |
def xor(b, s): return map(lambda x: x^b, map(lambda x: ord(x), s)) | |
M = sys.maxsize | |
M = 128 | |
def lcg(m, a, c, x): return (a*x + c) % m |
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 csv | |
import re | |
import urllib | |
with open('/Users/josen/Downloads/Honeynet Project Tools - Sheet1.csv', 'rb') as csvfile: | |
reader = csv.reader(csvfile) | |
pots = {} | |
for tool, typ, _, _, _, url, _ in reader: | |
pots[typ.strip()] = ['[%s](%s)' % (tool, url)] + pots.get(typ.strip(), []) |
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 scala.sys.process._ | |
val IP_PAT="(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})".r | |
val MAC_PAT="([a-f0-9]{1,2}:[a-f0-9]{1,2}:[a-f0-9]{1,2}:[a-f0-9]{1,2}:[a-f0-9]{1,2}:[a-f0-9]{1,2})".r | |
val res = "arp -na" !! | |
(IP_PAT + "[^\\d]* .+ " + MAC_PAT).r.findAllMatchIn(res).map(_.subgroups).map(x => (x.head, x.last)).toMap // cala.collection.immutable.Map[String,String] = Map(192.168.0.102 -> 80:e6:50:25:xx:xx, ...) |
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
def getNonLetters(s:String): List[Int] = s.map(_.isLetter).zipWithIndex.filter(_._1==false).map(_._2).toList | |
def getUpperCase(s:String): List[Int] = s.map(_.isUpper).zipWithIndex.filter(_._1==true).map(_._2).toList | |
def makeLetters(s:String): List[Char] = s.toList.filter(_.isLetter == true) | |
def mkUpper(upps:List[Int], s:String): String = { | |
def loop(is:List[Int], s:String): String = { | |
is match { | |
case Nil => s |
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
def garland(word:String): Int = { | |
def loop(word:String, n:Int, sofar:Int): Int = { | |
//println(word.slice(0, n)) | |
if (n+1 == word.length) {return sofar} | |
word.endsWith(word.slice(0,n)) match { | |
case false => loop(word, n+1, sofar) | |
case true => loop(word, n+1, n) | |
} | |
} | |
loop(word, 1, 0) |
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
from sys import argv | |
move_space = "abcdefg" | |
gameboard = [['.' for x in range(7)] for x in range(6)] | |
def place_move(column, player): | |
col = move_space.index(column.lower()) | |
for row in range(6): | |
if gameboard[row][col] == '.': | |
gameboard[row][col] = player |
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
from recon.core.module import BaseModule | |
from datetime import datetime | |
import re | |
import socket | |
from BeautifulSoup import BeautifulSoup | |
# for https://bitbucket.org/LaNMaSteR53/recon-ng/ | |
class Module(BaseModule): |