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
import csv | |
# Configuration | |
header_line = 1 | |
limit = 65000 | |
target_file = 'file-to-split.csv' | |
# Initial output file | |
iterator = 0 | |
new_file_prefix = target_file.replace('.csv','')+'_split_' | |
file_num = 1 | |
# Reading file |
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 | |
//error_reporting(E_ALL); | |
//ini_set('display_errors', '1'); | |
$dv = new divide_num(101); | |
$arr = array(111, 222, 333); | |
var_dump($arr); | |
foreach ($arr as $key=>$ar) { |
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
// | |
// main.m | |
// parseSshConfig | |
// | |
// "A very simple .ssh config file parser." | |
// | |
// Created by Justin Swanson on 8/17/12. | |
// Copyright (c) 2012 h4xful.net. All rights reserved. | |
// |
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. |
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
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
#!/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
#!/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/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
// ==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 __ |