Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nate-parrott committed Feb 10, 2015
2 parents 3ae4e7e + 1badd57 commit a621f94
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 0 deletions.
Binary file added PluginDirectories/1/ccgenerator.bundle/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions PluginDirectories/1/ccgenerator.bundle/examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
visa
master
mastercard
amex
diners
jcb
discover
hiper
hipercard
9 changes: 9 additions & 0 deletions PluginDirectories/1/ccgenerator.bundle/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "ccgenerator",
"displayName": "Credit Card Generator",
"description": "Generates a valid credit card number",
"examples": ["visa", "mastercard", "amex", "diners", "jcb", "discover", "hipercard"],
"categories": ["Developer"],
"creator_name": "Guilherme Araújo",
"creator_url": "http://www.github.com/guilhermearaujo"
}
57 changes: 57 additions & 0 deletions PluginDirectories/1/ccgenerator.bundle/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
def results(parsed, query):
from random import randint
from random import choice
from re import findall

cc = ""
length = 0

if ("visa" in query.lower()):
cc += "4"
length = 16

if ("master" in query.lower()):
cc += str(randint(51,55))
length = 16

if ("amex" in query.lower()):
cc += choice(["34", "37"])
length = 15

if ("diners" in query.lower()):
cc += "54"
length = 16

if ("jcb" in query.lower()):
cc += str(randint(3528, 3589))
length = 16

if ("discover" in query.lower()):
cc += choice(["6011", str(randint(622126, 622925)), str(randint(644, 649)), "65"])
length = 16

if ("hiper" in query.lower()):
cc += "384"
length = 16

while (len(cc) < length - 1):
cc += str(randint(0,9))

cc += str(luhn(cc))

return {
"title": "Copy {0} to clipboard".format(" ".join(findall('....?', cc))),
"run_args": [cc]
}

def run(message):
from os import system

system('echo ' + message + " | pbcopy && osascript -e 'display notification \"Credit card copied to clipboard.\" with title \"Flashlight\"'")

def luhn(input):
digits = [int(c) for c in input if c.isdigit()]
digits.reverse()
doubled = [2 * d for d in digits[0::2]]
total = sum(d - 9 if d > 9 else d for d in doubled) + sum(digits[1::2])
return (total * 9) % 10
Binary file added PluginDirectories/1/thing.bundle/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions PluginDirectories/1/thing.bundle/examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
thing ~thingquery(query here)
t ~thingquery(query here)
6 changes: 6 additions & 0 deletions PluginDirectories/1/thing.bundle/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Thingiverse",
"displayName": "Thingiverse",
"description": "Search Thingiverse for 3D printable models",
"examples": ["thing extruder upgrade", "t wall plate customizer"]
}
26 changes: 26 additions & 0 deletions PluginDirectories/1/thing.bundle/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import urllib, json

def results(parsed, original_query):
search_specs = [
["Thingiverse", "~thingquery", "http://www.thingiverse.com/search?q="],
]
for name, key, url in search_specs:
if key in parsed:
search_url = url + urllib.quote_plus(parsed[key])
return {
"title": "Search {0} for '{1}'".format(name, parsed[key]),
"run_args": [search_url],
"html": """
<script>
setTimeout(function() {
window.location = %s
}, 500);
</script>
"""%(json.dumps(search_url)),
"webview_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
"webview_links_open_in_browser": True
}

def run(url):
import os
os.system('open "{0}"'.format(url))

0 comments on commit a621f94

Please sign in to comment.