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
SELECT concat('alter table ',table_schema,'.',table_name,' DROP FOREIGN KEY ',constraint_name,';') from information_schema.table_constraints WHERE constraint_type='FOREIGN KEY' AND table_schema='<database_name>'; |
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
""" | |
remove_foreign_keys.py | |
Removes all the foreign key constraints in a django project's MySQL database. | |
NO FOREIGN KEYS = NO FOREIGN KEY HEADACHES | |
(of course if you are using anything other than the django ORM its likely to cause other headaches) | |
Before running this script be sure your django settings module is available | |
to your environment. |
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
\begin{itemize} | |
\renewcommand{\labelitemi}{ } | |
\item | |
... |
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
module RawSqlUtil | |
def sql_select(sql, params) | |
# We have to do this weirdness because sanitize_sql_array is a protected method | |
query = ActiveRecord::Base.send(:sanitize_sql_array, [sql].concat(params)) | |
ActiveRecord::Base.connection.select_all(query) | |
end |
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 | |
# current-tasks.py | |
# author: Anthony McClosky - http://amcclosky.com | |
import requests | |
import json | |
JIRA_ROOT_URL = "jira.example.com" | |
JIRA_API_ENDPOINT = "http://%s/rest/api/2.0.alpha1/" % JIRA_ROOT_URL |
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
task :history => :environment do | |
item = Item.find(21064127) | |
start_date = item.updated.to_date - 90 | |
item.item_logs.delete_all | |
90.times do |i| | |
if i % 7 == 0 | |
item_log = ItemLog.new | |
item_log.company_id = item.company_id | |
item_log.item_id = item.id | |
item_log.beforePrice = item.price |
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
package com.amcclosky.nativelib; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
public class NativeLibrary { | |
public static final long NULL = 0; | |
protected static final Logger log = Logger.getLogger(Peer.class.getPackage().getName()); |
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
# Start an HTTP server from a directory, optionally specifying the port | |
# via - http://dl.dropbox.com/u/39519/talks/io-tooling/index.html#13 | |
function server() { | |
local port="${1:-8000}" | |
open "http://localhost:${port}/" | |
python -m SimpleHTTPServer "$port" | |
} |
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
0 - Read http://blog.databigbang.com/running-your-own-anonymous-rotating-proxies/ | |
1 - Install monit, haproxy, tor and delegated. | |
2 - Setup your environment in the setup.rb file | |
3 - Just run > ruby setup.rb | |
4 - ........... | |
5 - PROFIT! > http://www.southparkstudios.com/clips/151040/the-underpants-business |
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
javascript:(function(){ $('.profiler-results').toggle(); })(); |
OlderNewer