Skip to content

Instantly share code, notes, and snippets.

View jubianchi's full-sized avatar
🏳️‍🌈
nyan nyan nyan

Julien BIANCHI jubianchi

🏳️‍🌈
nyan nyan nyan
View GitHub Profile
@quickshiftin
quickshiftin / osx-brew-gnu-coreutils-man.sh
Created February 21, 2014 07:25
Running GNU coreutils via Homebrew on your Mac? Here's a one-liner to get the manpages working!
# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _'
@mageekguy
mageekguy / gist:8023349
Last active December 31, 2015 17:58
POC of something which must be interesting…
<?php
namespace classception;
class asserter
{
protected $actual = null;
public function __construct($actual)
{
public function acceptClient($clientsSocket)
{
$this->pollSocket($clientsSocket)->onRead(array($this, __FUNCTION__));
$clientSocket = new server\socket($this->acceptSocket($clientsSocket), $this);
$timeoutHandler = function() use ($clientSocket) {
$this->writeInfo('Client ' . $clientSocket->getPeer() . ' timeout!');
$clientSocket->close();
@scalp42
scalp42 / check_resource.rb
Created November 22, 2013 21:04
Figure if a resource exists or not in Chef before notifying it
resource_not_found = {}
begin
resources('ruby_block[my-resource-supposed-to-exist]')
rescue Chef::Exceptions::ResourceNotFound
resource_not_found['ruby_block[my-resource-supposed-to-exist]'] = true
end
template '/etc/my/template.conf' do
source 'template.conf.erb'
mode '640'
@marmotz
marmotz / bencher.js
Last active December 27, 2015 11:09
VERY simple benchmarker for code. Produce a light report on console.
/**
* VERY simple benchmarker for code.
* Produce a light report on console.
*
* USAGE:
*
* Bencher.get('a bench description').start();
*
* // code here
*
@mageekguy
mageekguy / gist:7302015
Last active December 27, 2015 09:09
CC
# Indenting and Whitespace
Use only tabs, with no space.
Lines should have no trailing whitespace at the end.
Files should be formatted with \n as the line ending (Unix line endings), not \r\n (Windows line endings).
PHP files should be in UTF-8.
PHP files should begin with `<?php ` and should not have a end tag (no `?>`).
The reasons for this can be summarized as:
* Removing it eliminates the possibility for unwanted whitespace at the end of files which can cause "header already sent" errors, XHTML/XML validation issues, and other problems.
* The closing delimiter at the end of a file is optional.
@cvan
cvan / gist:6444031
Created September 4, 2013 23:07
convert URI of image to data URI
// Load an image in your browser and paste this in your console
var i=new Image();i.src=document.location.href;i.onload=function(){var c=document.createElement('canvas');c.width=this.width;c.height=this.height;c.getContext('2d').drawImage(this,0,0);window.location=c.toDataURL('image/png');};
@ariesjia
ariesjia / IE hack
Created September 4, 2013 10:38
IE6 7 8 9 10 hack
To target IE 6 and 7
@media screen\9 {
body { background: red; }
}
To target IE 6, 7 and 8
@media \0screen\,screen\9 {
body { background: green; }
}
@pvh
pvh / gist:6394061
Last active December 22, 2015 01:08

The PHP language owner is responsible for the success of Heroku developers building in PHP. They are part of the broader “languages team”, a group of developers with similar language-specific responsibilities and shared infrastructure.

A language owner will be responsible for varying degrees of

  • building core language-specific features such as the “build pack”,
  • working within the community to improve projects upstream to provide a better experience for Heroku users,
  • customer outreach,
  • customer support,
  • sales support,
  • language-specific documentation and content, and
  • marketing responsibilities such as attending and speaking at conferences.
@lyrixx
lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'