Skip to content

Instantly share code, notes, and snippets.

Santi badp

Block or report user

Report or block badp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@badp
badp / 0.md
Last active Dec 20, 2019
awful code done quick
View 0.md
@badp
badp / Pipfile
Last active Jul 6, 2019
poetrade is down
View Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
ipython = "*"
pylint = "*"
[packages]
@badp
badp / cs.fish
Last active Aug 23, 2016
Hastily hacked together color highlighting for csearch
View cs.fish
function cs -a term
csearch -n -- $term \
| env GREP_COLORS='mt=02;35' grep --color=always -P '^[^:]+:[^:]+:' \
# http://unix.stackexchange.com/a/305262/2179
| env grep --color=always -P -- $term \
| less -RFX
end
@badp
badp / better_in_every_single_way.py
Last active Aug 29, 2015
Calculate partial product ordering over dictionaries of tuples assuming bigger numbers are better than smaller numbers, and strings are better than others if they have more of each character ("FFF" > "FF" but "FFF" ≯ "FA")
View better_in_every_single_way.py
# Name (Def Def% MDef Mdef% Slots Links, Rate, Flags)
ff7_armor = {
"Bronze Bangle": (8, 0, 0, 0, 0, 0, 0, ""),
"Iron Bangle": (10, 0, 2, 0, 1, 0, 1, ""),
"Titan Bangle": (14, 2, 4, 0, 2, 0, 1, ""),
"Mythril Armlet": (18, 3, 8, 0, 2, 1, 1, ""),
"Carbon Bangle": (27, 3, 14, 0, 3, 1, 1, ""),
"Silver Armlet": (34, 4, 22, 0, 3, 1, 1, ""),
"Gold Armlet": (46, 4, 28, 0, 4, 2, 1, ""),
"Diamond Bangle": (57, 6, 37, 0, 5, 2, 1, ""),
@badp
badp / xen_cpuid_verify.py
Created Aug 27, 2013
Check XEN CPUIDs for vailidity. I didn't end up using this code, so here it is under the WTFPL.
View xen_cpuid_verify.py
import re
import unittest
def IsValidXenCPUID(cpuid_mask):
# host(,[0-9a-z]+=([a-z]|[0-9])+)*
libxl_syntax = re.compile(r"""
host #required header
( #plus many of the following:
, #comma separator
[0-9a-z]+ #field name
View borderlands2dps.py
"""
This is terribly written but still it should give you a broad idea of whether or not a gun is better than the other or not.
This keeps track of:
* Damage
* Fire rate
* Reload time
* Magazine
* Elemental damage
* Damage type (vs flesh, shield, armor)
@badp
badp / youtube_cleanser.js
Created Apr 29, 2012
Enough with people reuploading others' stuff on their own Youtube channels.
View youtube_cleanser.js
badChannels = ["gamehelper", "gamerspawn", "machinima", "vaivecorporation", "loquendoitalia", "patron500", "jon3pnt0"]
$(jQuery.grep($(".video-list-item, .result-item, .result-item-main-content, .sidebar-ads, .yt-tile-default"),
function(item, number){
//filter regular videos
username = $(item).find(".yt-user-name").text().toLowerCase();
console.debug(username)
if(badChannels.indexOf(username) != -1) return true;
//perhaps it's an ad.
@badp
badp / balsamiq mockup
Created Mar 8, 2012
TF2WH eternal overstock suggestion
View balsamiq mockup
<mockup version="1.0" skin="sketch" measuredW="962" measuredH="562" mockupW="902" mockupH="542">
<controls>
<control controlID="36" controlTypeID="com.balsamiq.mockups::Canvas" x="60" y="20" w="700" h="542" measuredW="100" measuredH="70" zOrder="0" locked="false" isInGroup="-1"/>
<control controlID="37" controlTypeID="com.balsamiq.mockups::Title" x="75" y="35" w="-1" h="-1" measuredW="180" measuredH="41" zOrder="1" locked="false" isInGroup="-1">
<controlProperties>
<size>32</size>
<text>The%20Cat%20Hat</text>
</controlProperties>
</control>
<control controlID="38" controlTypeID="com.balsamiq.mockups::Title" x="75" y="76" w="-1" h="-1" measuredW="119" measuredH="24" zOrder="2" locked="false" isInGroup="-1">
@badp
badp / crafting.txt
Created Jul 11, 2011
crafting.plantuml
View crafting.txt
@staruml
version
@enduml
@startuml weapons2.svg
title Last updated January 17th 2012.
hide empty members
@badp
badp / gist:972197
Created May 14, 2011
moar crawl bling.css
View gist:972197
#stats .bg10, /* health bar start */
#stats .bg1, /* mana bar start */
#stats .bg0 + .bg9, /* all mana recently used */
#stats .bg0 + .bg4, /* "all" health recently lost */
#thingadongdong
{
border-top-left-radius: 7px;
border-bottom-left-radius: 7px;
}
You can’t perform that action at this time.