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
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import requests | |
| import csv | |
| import urllib.parse | |
| from time import sleep | |
| # Constant | |
| SEMRUSH_APIKEY = '' |
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
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import with_statement # we'll use this later, has to be here | |
| from argparse import ArgumentParser | |
| import requests | |
| from BeautifulSoup import BeautifulStoneSoup as Soup | |
| def parse_sitemap(url): |
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
| Download TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib. | |
| And use command | |
| pip install TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl |
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
| # Thanks : http://stackoverflow.com/questions/15461737/how-to-execute-xpath-one-liners-from-shell | |
| xmlstarlet sel -t -v "//element/@attribute" file.xml |
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
| # Functions | |
| #----------------------------------------------------------------------------- | |
| info() { | |
| echo -e "\r\e[0;32m [INFO]\e[0m $*" | |
| logger -p local7.info -t "$APPLICATION[$$]" "$*" | |
| } | |
| exi() { | |
| echo -e "\r\e[0;31m [ERROR]\e[0m $*" | |
| logger -p local7.err -t "$APPLICATION[$$]" "$*" |
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
| #!/bin/bash | |
| echo -e "Ubuntu cleaner v0.1" | |
| # We verify if we are root user | |
| if [ ! `whoami` = "root" ] | |
| then | |
| echo -e "You are not root, you can't launch this script !" | |
| exit 1 | |
| fi |
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
| # Source : http://stackoverflow.com/questions/13804501/zf2-how-to-set-search-form-in-layout | |
| Some ways to do that in your controller: | |
| Using view model | |
| $viewmodel = new ViewModel(); | |
| $viewmodel->setVariable('myvar', $myvar); | |
| return $viewmodel; | |
| Using layout() |
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
| class Module | |
| { | |
| public function onBootstrap($e) | |
| { | |
| $app = $e->getParam('application'); | |
| $app->getEventManager()->attach(MvcEvent::EVENT_RENDER, array($this, 'setFormToView'), 100); | |
| } | |
| public function setFormToView($event) | |
| { |
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
| # Zend # | |
| ##################### | |
| nbproject | |
| ._* | |
| .~lock.* | |
| .buildpath | |
| .idea | |
| .project | |
| .settings | |
| INSTALL.txt |
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
| convert -page A4 -compress jpeg image.jpg out.pdf |
NewerOlder