Skip to content

Instantly share code, notes, and snippets.

@Hadryan
Hadryan / jquery.djax.js
Created July 20, 2013 13:53
a class of no-djax added to the original djax to have non-updatable internal links/elements. modification to have inline scripts at the end of updatable zone.
/*
* jQuery djax
*
* @version v0.122
*
* Copyright 2012, Brian Zeligson
* Released under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Homepage:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
@Hadryan
Hadryan / hatchshow.js
Created March 3, 2016 21:03 — forked from charliepark/hatchshow.js
A jquery typography plugin.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(window).load(function(){
$().hatchShow();
});
jQuery.fn.hatchShow = function(){
$('.hsjs').css('display','inner-block').css('white-space','pre').each(function(){
var t = $(this);
t.wrap("<span class='hatchshow_temp' style='display:block'>");
var pw = t.parent().width();
@Hadryan
Hadryan / .block
Created April 18, 2016 12:43 — forked from mbostock/.block
Gradient Bump
license: gpl-3.0
@Hadryan
Hadryan / httpstatus
Created July 14, 2016 15:39 — forked from rsvp/httpstatus
httpstatus : bash script to get HTTP response code with optional status message (includes verbose definitions in comment)
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-08-25
#
# _______________| httpstatus : get HTTP status code
#
# Usage: httpstatus URL [timeout] [--code or --status] [see 4.]
# ^message with code (default)
# ^code (numeric only)
# ^in secs (default: 3)
# ^URL without "http://" prefix works fine.
@Hadryan
Hadryan / google-img-resize.mdown
Created August 5, 2016 12:34
Google’s authentication-less on-the-fly image resizing service

Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML. Jotting down some notes felt like a good idea, so here goes. If you know more about this API, let me know, please!

(Word of warning: I spent ~30 minutes on both my experimentation and this here write-up, so it might not be the most thought-provoking, brilliant thing you read today.)

@Hadryan
Hadryan / nginx.conf.erb
Created August 15, 2016 15:05 — forked from vs0uz4/nginx.conf.erb
Sample for Nginx settings on Openshift
# Enable Gzip
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_proxied any;
gzip_types
text/css
text/javascript
@Hadryan
Hadryan / font-stacks.css
Created September 22, 2016 21:31 — forked from ct27stf/font-stacks.css
Similar looking fonts for Windows, Linux, Mac
.mono-font-stack {
font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
}
.times-font-stack {
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
}
.modern-font-stack {
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@Hadryan
Hadryan / array_column_recursive.php
Created February 3, 2017 10:08 — forked from tripflex/array_column_recursive.php
PHP customized array_column function for recursion, named array_column_recursive
if ( ! function_exists( 'array_column_recursive' ) ) {
/**
* Returns the values recursively from columns of the input array, identified by
* the $columnKey.
*
* Optionally, you may provide an $indexKey to index the values in the returned
* array by the values from the $indexKey column in the input array.
*
* @param array $input A multi-dimensional array (record set) from which to pull
* a column of values.
@Hadryan
Hadryan / request_async.php
Created May 22, 2017 10:47 — forked from Yarkhan/request_async.php
multiple parallel asynchronous requests on php
<?php
/**
* PHP7 OF GTFO
*/
function request_async(array $urls, callable $callback){
$multiHandle = curl_multi_init();
$handles = [];
foreach($urls as $key => $url){
$ch = curl_init($url);