Skip to content

Instantly share code, notes, and snippets.

View ntzm's full-sized avatar
🐝

Nat Zimmermann ntzm

🐝
View GitHub Profile
@lisachenko
lisachenko / instantinators.php
Created August 1, 2018 08:11
Private class instantinators
<?php
/**
* Sealed class can not be created directly
*/
class Seal
{
private function __construct()
{
// private ctor prevents from direct creation of instance
}
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class MakeAll extends Command
{
/**
* The name and signature of the console command.
*
@ntzm
ntzm / submitted-to-reddit.js
Last active August 29, 2015 14:26
Bookmarklet to check if link has been submitted to reddit
javascript:function tbstjko(j){var c=j.data.children;var l=c.length;if(l==0){alert('Not submitted')}else{var t='';for(i=0;i<l;i++){t+=' * '+c[i].data.subreddit+'\n'}alert('submitted to\n'+t)}}(function(){var u=window.location.href;var v='https://reddit.com/api/info.json?jsonp=tbstjko&url='+u;var h=document.head;var s=document.createElement("script");s.setAttribute("src", v);h.appendChild(s);h.removeChild(s);void(0)})()