Skip to content

Instantly share code, notes, and snippets.

View justinyost's full-sized avatar

Justin Yost justinyost

View GitHub Profile
@beporter
beporter / git-deploy
Last active June 9, 2016 18:02
A git add-on script that automates fast-forwarding branches to each other, pushing to the default remote (origin) and triggering pre/post scripts. Read `usage()` for details.
#!/usr/bin/env bash
#
# https://gist.github.com/beporter/8074237fa5a71f77dc5c
# [email protected]
# 2015-09-14
#---------------------------------------------------------------------
usage ()
{
@ricog
ricog / gist:9df21476cc7ff697aad3
Last active August 29, 2015 14:07
Disabling SSLv3 on HTTPS web servers
@pengwynn
pengwynn / octocat_zen.sh
Created November 14, 2012 02:42
GitHub Zen
$ curl https://api.github.com/zen | octocatsay
MMM. .MMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMM ____________________________
MMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMM | Practicality beats purity. |
MMMMMMMMMMMMMMMMMMMMMMMM |_ ________________________|
MMMM::- -:::::::- -::MMMM |/
MM~:~ ~:::::~ ~:~MM
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@nikic
nikic / password_hashing_api.md
Created September 12, 2012 15:04
The new Secure Password Hashing API in PHP 5.5

The new Secure Password Hashing API in PHP 5.5

The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:

Why do we need a new API?

Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.

@soffes
soffes / perferences.json
Created August 22, 2012 05:35
My Sublime Text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@justinyost
justinyost / paging.ctp
Created March 20, 2012 16:05
Paging Element for Twitter Bootstrap and CakePHP 2.0+
<?php $span = isset($span) ? $span : 8; ?>
<?php $page = isset($this->request->params['named']['page']) ? $this->request->params['named']['page'] : 1; ?>
<div class="pagination">
<ul>
<?php echo $this->Paginator->prev(
'&larr; ' . __('Previous'),
array(
'escape' => false,
'tag' => 'li'
),
@remy
remy / pad.js
Created March 16, 2012 14:59
2 digit pad
// a bunch of ways to get from 4 => 04 (whilst maintaining 40 => 40). This would be a pad function for times, hours, mins, seconds.
var i = 4;
// while
while((i+'').length<2)i='0'+i
// greater than 9
i=(i>9?i:'0'+i)
@matthewmccullough
matthewmccullough / .gitconfig.ini
Created December 31, 2011 18:16
Alternate URLs (insteadOfs) for GitHub Git repos
[url "git://github.com/"]
insteadOf = "ghg://"
pushInsteadOf = "ghg://"
# Example: git clone ghg://ntschutta/emacs
[url "git://github.com/matthewmccullough/"]
insteadOf = "ghgm://"
pushInsteadOf = "ghgm://"
# Example: git clone ghgm://hellogitworld
[url "[email protected]:"]
insteadOf = "ghs://"