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 change(array_of_denominations, amount): ==> Number of ways you can make change | |
# """ | |
# change([1, 5], 6) => 2 | |
# change([1, 5], 10) => 3 | |
# """ | |
def change(array_input, amount): | |
if amount == 0: | |
return 1 | |
elif amount < 0 or len(array_input) == 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
$ ./sqli8_blind_injection.py -u http://172.28.128.3:8007/membre.php\?id\=7 -e Mickey | |
OtherInformation: | |
* idusers | |
-> 7,8,9,10,11 | |
* useyourname | |
-> Mickey,Kenshin,Jin,Camus,Pierre | |
* position |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
$ ./sqli9_bf.py | |
The password is 'bfmoisitupeux' | |
""" |
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
window.confirm=function(){return true};$.each($(".pet-button"),function(){s=$(this).scope();if(!s.cp){s.cp=s.choosePet.bind({});s.choosePet=function(e,p){f=s.selectedFood.key;nb=Math.min((50-s.user.items.pets[e+"-"+p])/5,s.user.items.food[f]);for(i=0;i<nb;i+=1){s.cp(e,p);s.chooseFood(f)}}}}) |
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
s=angular.element($0).scope();for(i=0;i<s.user.stats.mp/s.skill.mana;i+=1){setTimeout(function(){s.castStart(s.skill);},i*2000);} |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
''' | |
Find your item id (by looking at your webpage source), and query as follow: | |
$ ./get_mem_for_item.py -i 41006508 | |
http://www.memrise.com/mem/4321815/i-intend-to-become-a-lawyer/ | |
$ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# $ benchmark.py | |
# | |
# Test with test_argpartition: | |
# Results: | |
# [[78 55 72] | |
# [ 0 50 15] | |
# [ 8 44 27] |
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
#!/bin/bash | |
# Notification timer, to drop in ~/bin/ | |
function timer () { | |
while [ "$(date "+%H:%M")" != "$exec_time" ] | |
do | |
sleep 60 | |
done | |
notify-send -i dialog-warning "$title" "$message" |
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
#compdef fab | |
_targets() { | |
_describe -t commands "fabric targets" target_list | |
} | |
output_levels=( | |
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.' | |
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!' | |
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.' |
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
"""" | |
Required: fabric, django, coverage, django-coverage, termcolor | |
"""" | |
from coverage.misc import CoverageException | |
from termcolor import colored | |
def coverage(html=1): | |
"""Run coverage tests with html output, or | |
or return only the coverage percentage:: |