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 | |
| # | |
| # Crawls a domain | |
| # Retreives all visible URLs and their page titles | |
| # Saves to CSV | |
| # $1 = URL (no http(s)) | |
| # $2 = csv title | |
| # MODIFY - wget include directories, domain, and --reject-regex TODO - make a variable | |
| # Text color variables |
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
| $doc = [xml]'<opml version="2.0"><body/></opml>' | |
| $body = $doc.selectSingleNode('//body') | |
| # somafm.com channels.. | |
| foreach($ch in (irm http://somafm.com/channels.xml).selectNodes('//channels/*')) { | |
| $x = $doc.createElement('outline') | |
| $x.setAttribute('text', "SomaFM - $($ch.title.innerText)") | |
| $x.setAttribute('description', $ch.description.innerText) | |
| $x.setAttribute('category', "$($ch.genre)/AAC/128k/") | |
| $x.setAttribute('type', 'link') |
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
| :: Install choco .exe and add choco to PATH | |
| @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
| :: Install all the packages | |
| :::: Browsers | |
| choco install googlechrome -fy | |
| choco install firefox -fy | |
| :::: Text editors / IDEs | |
| choco install atom -fy |
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 | |
| # | |
| # Crawls a domain | |
| # Retreives all visible URLs and their page titles | |
| # Saves to CSV | |
| # $1 = URL | |
| # $2 = csv filename | |
| # | |
| # USAGE: | |
| # save this script as, say, crawler.sh”. |
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/env python | |
| import json | |
| import sys | |
| # See https://msdn.microsoft.com/en-us/library/aa753582%28VS.85%29.aspx | |
| # and https://github.com/shaarli/Shaarli/blob/v0.6.5/index.php#L1899 | |
| HEADER = u'<!DOCTYPE NETSCAPE-Bookmark-file-1><DL>' | |
| FOOTER = u'</DL>' | |
| ITEM = u'<DT><A HREF="{url}" ADD_DATE="{time_created}" TAGS="{tags}">{title}</A>' |
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
| import os, sys, re | |
| patterns = [ | |
| # <img src='http://s.wordpress.com/latex.php?latex=%5Cmathcal%7BO%7D%28n%29&bg=T&fg=000000&s=0' alt='\mathcal{O}(n)' title='\mathcal{O}(n)' class='latex' /> | |
| (r'<img.*?title=\'(.*?)\' class=\'latex\' />', | |
| '$$ \\1 $$ ', | |
| 0), | |
| # [<img class=" size-full wp-image-1722 aligncenter" src="http://erikbern.com/wp-content/uploads/2016/01/avg.png" alt="avg" width="512" height="512" />](http://erikbern.com/wp-content/uploads/2016/01/avg.png) | |
| (r'\[(<img.*?)\]\(.*?\)', |
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
| <?php | |
| function my_find_expired_events( $ids ) { | |
| $args = array( | |
| 'post_type' => 'tribe_events', | |
| 'nopaging' => true, | |
| 'fields' => 'ids', | |
| 'meta_query' => array( | |
| array( |
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 | |
| if [[ ! "${#}" == 2 ]] ; then | |
| echo "Please provide input and output directories, and no other arguments." | |
| exit 1 | |
| fi | |
| input="${1}" | |
| output="${2}" |
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
| git checkout master | |
| git merge develop | |
| git push -u origin master |
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
| <?php | |
| /******************************* | |
| * this will work in the loop | |
| *******************************/ | |
| /* check if the posts publish date is older than 60 days */ | |
| if( strtotime( $post->post_date ) < strtotime('-60 days') ) { | |
| /* post is older than 60 days - do something with it!! */ | |