Skip to content

Instantly share code, notes, and snippets.

View scryba's full-sized avatar

Michael Laweh scryba

View GitHub Profile
@hpbuniat
hpbuniat / popunder.html
Created June 12, 2011 19:44
Test for a popunder working in ff 3-14, chrome 10-21, ie6-9
<!DOCTYPE html>
<html>
<head>
<meta content="Hans-Peter Buniat" name="author">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Form-Submit Popunder</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<form id="testSubmit" action="http://www.google.com">
@kauhat
kauhat / copyBetweenDisks.php
Created December 14, 2017 12:44
Upload & copy files between disks in Laravel 5
<?php
use Illuminate\Http\File;
use Storage;
/**
* Load contents of file into memory and copy. Slower, but can copy from
* remote disks.
*
* @return void
@chrisgoddard
chrisgoddard / json-ld-gtm.html
Last active July 23, 2023 16:52
JSON-LD GTM Tag
<script>
(function(){
var data = {
"@context": "http://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{Page URL}}
},
"headline": {{SCHEMA - Article Headline}},
@davidgrzyb
davidgrzyb / UsersTable.php
Last active November 6, 2023 18:29
Livewire Infinite Scroll Example
<?php
namespace App\Http\Livewire;
use App\Models\User;
use Livewire\Component;
class UsersTable extends Component
{
public $totalRecords;
@tyndyll
tyndyll / extract.py
Created January 23, 2015 18:49
Parsing Maildir Mail Stored on Disk with Python
def unicode_it(data):
# Take a string of data and convert it to unicode
try:
return unicode(data, errors="replace").strip()
except TypeError as E:
return u""
def extract(msg, msg_obj, attachments):
if msg.is_multipart():
for part in msg.get_payload():
@tylerhall
tylerhall / strong-passwords.php
Created August 12, 2010 21:38
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
@bsara
bsara / git-ssh-auth-win-setup.md
Last active April 22, 2024 13:49
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@gruber
gruber / Liberal Regex Pattern for Web URLs
Last active April 22, 2024 19:02
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@seven1m
seven1m / open_source_church_software.md
Last active April 24, 2024 08:38
List of Open Source Church Software