Skip to content

Instantly share code, notes, and snippets.

View minthemiddle's full-sized avatar

Martin minthemiddle

View GitHub Profile
@minthemiddle
minthemiddle / cloudSettings
Last active March 3, 2017 11:07
Visual Studio Code Sync Settings Gist
{"lastUpload":"2017-03-03T11:07:30.416Z","extensionVersion":"v2.5.1"}
@minthemiddle
minthemiddle / qrcreator
Created April 16, 2015 12:25
Create QR codes from csv URL list using qrencode CLI
from subprocess import call
import csv
with open('urls.csv', 'r') as csvfile:
infile = csv.reader(csvfile)
for row in infile:
quality = '-s 300'
fileout = '-o '+row[0]+'.png'
filein = row[1]
call(["qrencode",fileout,quality,filein])
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
$urls = array('http://www.google.com','http://www.kicker.de','http://www.spiegel.de', 'http://www.karriere-papier-verpackung.de');
$urls2 = ["Transfermarkt" => "http://www.transfermarkt.de", "Kicker" => "http://www.kicker.de"];
foreach($urls2 as $title => $url){
echo "Pagerank " . $title . ": " . \SEOstats\Services\Google::getPageRank($url) . "\n";
@minthemiddle
minthemiddle / timestamp2humantime.php
Created March 3, 2015 12:14
Reads text file, converts stimetamps to human readable dates
<?php
$lines = file('timestamps.txt'); // one timestamp per line, no delimiters or other characters, num only
$humandates = array();
foreach($lines as $line_num => $line) {
$realdate = date('m/d/Y', $line);
array_push($humandates,$realdate);
}
@minthemiddle
minthemiddle / split-and-slice.py
Last active August 29, 2015 14:00
Simple line split and string removal/slice from the end of file
import os
string = """
Introduction 03:39
How to sell your websites for $15,000 09:16
SECTION 2: BEATING THE COMPETITION: HOW TO DIFFERENTIATE YOUR WEB DESIGN SERVICES
"""
stringSplit = ''