Skip to content

Instantly share code, notes, and snippets.

View minthemiddle's full-sized avatar

Martin minthemiddle

View GitHub Profile
@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 = ''
@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);
}
<?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 / 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])
@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 / laravel-test-stub.php
Created September 17, 2019 12:06
Laravel Test Stub
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\User;
class ExampleTest extends TestCase
@minthemiddle
minthemiddle / phpcs.xml
Created October 6, 2019 09:46
Laravel (5/6) config template for PHP Sniffer
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>The coding standard for this project.</description>
<rule ref="PSR2"/>
<file>app</file>
<file>bootstrap</file>
<file>config</file>
<file>database</file>
<file>resources</file>
@minthemiddle
minthemiddle / 191231-failure.log
Created December 31, 2019 13:21
191231-failure
FAILURES!
Tests: 1, Assertions: 4, Failures: 1.
PHPUnit\Framework\ExpectationFailedException : Failed asserting that '<!doctype html>\n
<html lang="en">\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
\n
<!-- CSRF Token -->\n
@minthemiddle
minthemiddle / Markdium-Hack.php
Created July 9, 2020 20:05
Markdium-Lessons Learnt: Confident Laravel
public function() {
return $this;
}
@minthemiddle
minthemiddle / Markdium-Hack.php
Created July 9, 2020 20:05
Markdium-Lessons Learnt: Confident Laravel
class PHPUnit extends TestCase
{
public function testAssertions()
{
$this->assertTrue(true);
}
}