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
<?php | |
function check_ip_range($target, $range_start, $range_end) | |
{ | |
if (ip2long($target) >= ip2long($range_start) && ip2long($target) <= ip2long($range_end)) | |
return true; | |
else | |
return false; | |
} |
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
<?php | |
/** | |
* StringTools | |
* Justin Swanson | |
* www.github.com/geeksunny | www.faecbawks.com | www.h4xful.net | |
* | |
* An example of this script can be found at http://beta.h4xful.net/tools/string_tools.php | |
*/ | |
if (isset($_POST['mode'])) | |
{ |
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
global app_state | |
-- check if itunes is running | |
set app_state to false | |
tell application "System Events" | |
if (exists process "iTunes") then set app_state to true | |
end tell | |
-- Adding files to the iTunes library when they are added to the watched folder | |
on adding folder items to my_folder after receiving the_files |
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
// ==UserScript== | |
// @name betterTwitter | |
// @version 0.5 | |
// @namespace http://www.h4xful.net/ | |
// @description Gets rid of the garbage on Twitter's side-panel. | |
// @include http://twitter.com/* | |
// @include https://twitter.com/* | |
// ==/UserScript== | |
// __ Change Log __ |
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/python | |
__author__ = 'Justin Swanson' | |
__version__ = '0.2' | |
import os # For running system commands & getting directory contents. | |
# Configuration dictionary variable: Will store the live OS's config status | |
configuration = {} | |
### Clear screen function... clears the command prompt window. |
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/python | |
name = 'n00blet' | |
# adopted: march 11, 2011 (the 3rd month of the year) | |
# born: ~june 2010? (Was approximately 9 months old at time of adoption.) | |
def strToInt(string): | |
total = 0 | |
for letter in string: | |
total += ord(letter) |
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/local/bin/python2 | |
import os # For running system commands. | |
import argparse # For argument parsing. | |
# Configuration | |
_setup_file_ = 'setup.py' # Your Py2App setup file. | |
_app_file_ = 'start.py' # Should mirror the APP variable in your Py2App setup file. | |
_delete_ = ['Frameworks/QtDeclarative.framework', 'Frameworks/QtMultimedia.framework', 'Frameworks/QtScript.framework', 'Frameworks/QtSvg.framework','Frameworks/QtXml.framework', 'Frameworks/QtDesigner.framework', 'Frameworks/QtNetwork.framework', 'Frameworks/QtScriptTools.framework','Frameworks/QtTest.framework', 'Frameworks/QtXmlPatterns.framework', 'Frameworks/QtHelp.framework', 'Frameworks/QtOpenGL.framework','Frameworks/QtSql.framework', 'Frameworks/QtWebKit.framework', 'Frameworks/libQtCLucene.4.dylib', 'Frameworks/phonon.framework', 'Frameworks/*.framework/*.prl'] # Files within [name].app/Contents/ to be deleted during the trimming process. | |
# DU function... uses the system's du command because Python's os.w |
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
on run argv | |
if (count argv) is not equal to 0 then | |
tell application "Terminal" | |
activate | |
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down | |
do script item 1 of argv in front window | |
end tell | |
#else | |
# display alert "Oops!" message "You didn't pass any parameters to this script!" as critical | |
end if |
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 data_input(type, prompt): | |
# Initialize variables. | |
valid = False | |
return_value = False | |
# Loop until data input is valid. | |
while valid == False: | |
input = raw_input(prompt) | |
try: | |
if type == 'int': | |
return_value = int(input) |
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
# Instead of this... | |
def on_actionBuild_Zip_triggered(self): | |
[...] | |
# ... We do this. | |
def on_actionBuild_Zip_triggered(self, checked=None): | |
if checked is None: return # Makes certain the action does not get ran twice. | |
[...] | |
# This ensures that when it does get called twice, the second time will be ignored immediately. |
OlderNewer