Skip to content

Instantly share code, notes, and snippets.

View l4ci's full-sized avatar

Volker Otto l4ci

View GitHub Profile
@l4ci
l4ci / humans.txt
Last active December 14, 2015 23:49
humans.txt
/* humanstxt.org/ */
/* The humans responsible & technology colophon */
_ _ _ _ _
| | | | | | | | |
__ _____ | | | _____ _ __ ___ | |_| |_ ___ _ __ ___| |_
\ \ / / _ \| | |/ / _ \ '__/ _ \| __| __/ _ \ | '_ \ / _ \ __|
\ V / (_) | | < __/ | | (_) | |_| || (_) || | | | __/ |_
\_/ \___/|_|_|\_\___|_| \___/ \__|\__\___(_)_| |_|\___|\__|
@l4ci
l4ci / sprintf3.php
Last active December 15, 2015 03:29
sprintf3 - Replace %var% from a string #php
<?php
/**
* replaces %your_var% from a string
*
* sprintf3( 'Hello %your_name%, my name is %my_name%!'
* , array( 'your_name' => 'Matt'
* , 'my_name' => 'Jim'
* )
* );
*/
@l4ci
l4ci / trash_email.php
Last active December 15, 2015 03:29
Check Email Domain for trash/one-way-email #php
<?php
/**
* Checks Email Domain for trashmail
*
* @param string $email
* @return boolean true/false
*/
function trash_email($email){
$array = explode("@",$email);
$domain = $array[1];
@l4ci
l4ci / autolink.php
Last active December 18, 2015 03:49
Find and convert links in string #php
<script id="__bs_script__">//<![CDATA[
document.write("<script async src='http://HOST:3000/browser-sync/browser-sync-client.js?v=2.18.12'><\/script>".replace("HOST", location.hostname));
//]]></script>
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
.clearfix::after {
content: '';
display: table;
clear: both;
}
<?php
function get_host() {
if ($host = $_SERVER['HTTP_X_FORWARDED_HOST'])
{
$elements = explode(',', $host);
$host = trim(end($elements));
}
else
{
if (!$host = $_SERVER['HTTP_HOST'])
@l4ci
l4ci / jQuery: in view.js
Created January 9, 2018 10:09
Check if Element is in view
var $window = $(window);
$window_height = $window.height(),
scrollTop = $window.scrollTop();
/**
* Check if element visible in the viewport
*/
var aniElement = $('.animate');
var element_modifier = 0;
function checkIfInView() {