Skip to content

Instantly share code, notes, and snippets.

View adrian7's full-sized avatar
🦉
cărturar și filozof

Adrian Şilimon-Morariu adrian7

🦉
cărturar și filozof
View GitHub Profile
#!/usr/bin/env bash
# Example of supporting long (--long) and short (-s) options in bash via getopts
# Shorg options are declared at the beginning of the while block,
# while their counterparts (long options) are declared in the case block
# If the option requires a value, it should be declared as r: (letter followd by colon)
# and validated with needs_arg() when parsing.
# Alternatively die "Error message" is used to stop when we get an option which has not been declared
#!/usr/bin/env bash
curl -s -D - "$1" -o /dev/null
@adrian7
adrian7 / code-coverage-daylight.css
Created March 14, 2018 17:29
PHPUnit Code Coverage Daylight Style
/**
* PHPUnit Code Coverage Daylight Style
* Makes coverage pages more readable
*/
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');
body {
padding-top: 10px;
background: #f1f1f1;
@adrian7
adrian7 / fonts.scss
Created February 5, 2018 11:13 — forked from bradonomics/fonts.scss
Whitney & Sentinel Fonts CSS File (base64)
@font-face {
font-family: "Whitney SSm SC A";
src: url(data:application/x-font-woff;base64,d09GRk9UVE8AACSFAA0AAAAAN7gAAQAAAAAiXAAAAikAAAaRAAAAAAAAAABDRkYgAAAIzAAAFOgAABjhSw4xdkdERUYAAB20AAAAHQAAACAApQAER1BPUwAAHdQAAALQAAALHqpjoC9HU1VCAAAgpAAAAFoAAACA6dotXU9TLzIAAAGMAAAATwAAAGBZHFc/Y21hcAAABmgAAAJOAAADoIQ7xnlnYXNwAAAhAAAAAAgAAAAIAAAAC2hlYWQAAAEwAAAANAAAADYC7N5yaGhlYQAAAWQAAAAgAAAAJAd+A49obXR4AAAhCAAAAVMAAAHg/fogQW1heHAAAAGEAAAABgAAAAYAeFAAbmFtZQAAAdwAAASKAAALyqV9lZxwb3N0AAAIuAAAABMAAAAg/7gAMnjaY2BkYGBgZHC8dFVtYTy/zVcGbuYXQBGGC5y+JTD6/9X/KszPmB2AXA4GJpAoAGwsDKh42mNgZGBgPvBfgIGBRf//1f/XmZ8xAEVQQAUAoQcHEwAAUAAAeAAAeNpjYGKSYXRlYGVgYdrD1MXAwNADoRnvMhgx/GJAAgsZmP47MDBEw/geas75QEpZUYlZ4b8FwwnmAwwfgPz5IDkmIaarDApAyAQAvV8O/gB42rVUTW/bRhAdWXJsJ7ET+5jTNA2MpJBkyVBiK6eiBgznGhsJAvRQilqJdEQusVxaYZFD7+2xhx7yO3ruD+hP6I/p2+G6puJEcYFWhLhvZ+fjvZkFiehR43dqUPX7Fv8KN+hr7Cq8QmsUetykr+jc41bNZ5U26WePb+HkN4/XaEIfPF6nzcaKxxs1fHtlu3HP4zu002SP79bwZs1ni75p7nt8v8Zhu4Z3BDep0drA7qfm9x436Lj5l8crtNV66HGTvmv1PG7VfFbpQct4fIvWW794vEZ/tn71e
@adrian7
adrian7 / runlocal.sh
Last active February 11, 2017 14:22
runlocal - Build & run local environments (alternative to eb local run)
#!/usr/bin/env bash
###########################################################################################
# runlocal - Build & run a local environment using docker (alternative to eb local run) #
# Also cleans up containers and images built; #
# #
# usage: runlocal <path> [options...] #
# #
# @author: adrian7 <adrian.silimon.eu> #
# @version: 1.1 #
@adrian7
adrian7 / gist:ff8b7fa3dccb8b85b1bdc1af40de8fec
Created February 3, 2017 10:58 — forked from jcsrb/gist:1081548
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
@adrian7
adrian7 / putty-record
Created December 30, 2013 13:53
AutoIt Script to record the screen using CamStudio during a Putty session
#include <Constants.au3>
;
; AutoIt Script to record the screen using CamStudio during a Putty session
; @author Adrian7 (http://adrian.silimon.eu)
; @Tested on Windows7 only
;
; Links: Putty - http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
; CamStudio - http://camstudio.org/
;
@adrian7
adrian7 / wpmailbranding.php
Created August 24, 2012 19:16
Changes WP default From: Wordpress <wordpress@yourdomain.tld> emails header
/**
* Changes WP default From: Wordpress <wordpress@yourdomain.tld> emails header
* to From: Blogname <no-reply@yourdomain.tld>. Customizable, drop it in your theme's functions.php to take effect.
* @author Adrian7 (http://adrian.silimon.eu)
*/
function wp_mail_branding($args){
$wp_domain = @parse_url(get_bloginfo('url'));
$wp_domain = $wp_domain['host'];
@adrian7
adrian7 / requestbin.php
Created July 8, 2016 09:56
HTTP Request Bin
<?php
/**
* RequestBin - Captures and displays HTTP requests
* @author adrian7
* @version 1.1
*/
//TODO (1) Parse request data in a nice way
//TODO (2) Alternative nice display alongside raw
@adrian7
adrian7 / singleton.js
Created April 18, 2016 13:25
Javascript singleton
var Singleton = (function() {
var random = ( "My Private Random Int = " + parseInt(1000 * Math.random()) );
var privateVar = "My Private Variable";
function privateMethod () {
return ( "My privateMethod()\n" + privateVar );
}