This file contains hidden or 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
| from splinter.browser import Browser | |
| browser = Browser() | |
| browser.visit('http://media.douglasmiranda.com/labs/exemplos/splinter_pop-up/') | |
| parent_window = browser.current_window # Save the parent window | |
| browser.find_by_id('open-popup').first.click() | |
| for window in browser.windows: | |
| # Switch to a different window (the pop-up) |
This file contains hidden or 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
| sudo apt-get build-dep python-numpy python-scipy python-libsvm python-matplotlib | |
| pip install numpy | |
| pip install scipy | |
| pip install python-libsvm | |
| pip install matplotlib |
This file contains hidden or 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
| from fabric.api import * | |
| # current_git_branch = local('git symbolic-ref HEAD', capture=True).split('/')[-1] | |
| # === Environments === | |
| def development(): | |
| env.env = 'development' | |
| env.settings = '{{ project_name }}.settings.development' |
This file contains hidden or 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
| #-*-coding: utf-8 -*- | |
| ''' | |
| This module represents the recommender system for recommending | |
| new friends based on 'mutual friends'. | |
| ''' | |
| __author__ = 'Marcel Caraciolo <caraciol@gmail.com>' |
This file contains hidden or 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
| # Compress Files | |
| tar -zcvf foo.tar.gz /home/douglas/foo | |
| # Extract files | |
| tar -zxvf foo.tar.gz |
This file contains hidden or 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
| String.prototype.title_case = function () { | |
| return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); | |
| }; | |
| r = ''; | |
| $('#IdModelo option').each(function(){ | |
| r += 'u\''+$(this).text().title_case()+'\', '; | |
| }); | |
| console.log(r); |
This file contains hidden or 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
| ~$ cd /opt/VirtualBox | |
| ~$ ls -al | |
| ~$ sudo chmod +x uninstall.sh | |
| ~$ sudo sh uninstall.sh | |
| # then with 'cd' command move to the directory where is the .deb file, and execute it, example: | |
| ~$ cd ~/Downloads | |
| ~$ sudo dpkg -i virtualbox-4.1_4.1.20-80170~Ubuntu~precise_amd64.deb |
This file contains hidden or 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
| update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, "find this string", "replace found string with this string"); |
This file contains hidden or 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
| <!-- http://coderwall.com/p/p0nvjw?i=5&p=1&q= --> | |
| <ol class="breadcrumb"> | |
| <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> | |
| <a href="http://www.example.com/" itemprop="url"> | |
| <span itemprop="title">Example.com</span> | |
| </a> | |
| </li> | |
| <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> | |
| <a href="http://www.example.com/news" itemprop="url"> | |
| <span itemprop="title">News</span> |
This file contains hidden or 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
| # https://groups.google.com/forum/?fromgroups#!topic/django-brasil/TZBXSowifn8 | |
| from django.utils.encoding import smart_str, smart_unicode | |
| a = u'\xa1' | |
| print smart_str(a) |