##Description This bash script is changes /etc/hosts file with predefined environment.
##Usage
Just open script, change domain and IPs NOTE: you should escape dot with backslash
##Requirements
- perl
##TODO
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
##Description This bash script is changes /etc/hosts file with predefined environment.
##Usage
Just open script, change domain and IPs NOTE: you should escape dot with backslash
##Requirements
##TODO
| // originally by Camden Ross. Thanks | |
| /* bypass wordpress are you sure you want to logout screen when logging out of an already logged out account. */ | |
| function smart_logout() { | |
| if (!is_user_logged_in()) { | |
| $smart_redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '/'; | |
| wp_safe_redirect( $smart_redirect_to ); | |
| exit(); | |
| } else { | |
| check_admin_referer('log-out'); |
| #!/usr/bin/php | |
| <?php | |
| $input = file_get_contents('php://stdin'); | |
| preg_match('|^To: (.*)|', $input, $matches); | |
| $filename = tempnam('/var/log/mail', date('ymd-his-') . $matches[1] . '.'); | |
| file_put_contents($filename, $input); |
| class User < ActiveRecord::Base | |
| before_create :check_email_existence | |
| private | |
| def check_email_existence | |
| return true if !user = User.find_by_email(self.email) | |
| if !is_imported_user && !user.muo_id | |
| user.muo_id = self.muo_id |
/etc/apt/sources.list:deb http://www.rabbitmq.com/debian/ testing main
deb http://packages.erlang-solutions.com/ubuntu precise contrib
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'http://image.torrent.kg/images/U8x5261.png', false); | |
| xhr.responseType = 'arraybuffer'; | |
| xhr.send(); | |
| var blob = new WebKitBlobBuilder(); | |
| blob.append(xhr.response); | |
| var file = blob.getBlob('image/png'); | |
| console.log(file) | |
| var fd = new FormData(); | |
| fd.append("image[0]", file); |
| function upload(image){ | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', image.srcUrl, false); | |
| xhr.responseType = 'arraybuffer'; | |
| xhr.send(); | |
| var mime = xhr.getResponseHeader('Content-type'); | |
| var blob = new WebKitBlobBuilder(); | |
| blob.append(xhr.response); | |
| var file = blob.getBlob(mime); | |
| var fd = new FormData(); |
| function upload(image){ | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', image.srcUrl, true); | |
| xhr.responseType = 'arraybuffer'; | |
| xhr.onload = function(e) { | |
| if (this.status == 200) { | |
| var mime = xhr.getResponseHeader('Content-type'); | |
| var blob = new WebKitBlobBuilder(); | |
| blob.append(xhr.response); | |
| var file = blob.getBlob(mime); |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'http://diesel.elcat.kg/index.php?showtopic=10954635', true); | |
| xhr.onload = function(e) { | |
| if (this.status == 200) { | |
| console.log(xhr.response); | |
| } | |
| }; | |
| xhr.send(); |