-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/nate-parrott/Flashlight
- Loading branch information
Showing
8 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
visa | ||
master | ||
mastercard | ||
amex | ||
diners | ||
jcb | ||
discover | ||
hiper | ||
hipercard |
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
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" | ||
} |
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
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
thing ~thingquery(query here) | ||
t ~thingquery(query here) |
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
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"] | ||
} |
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
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)) |