Skip to content

Instantly share code, notes, and snippets.

View sebacruz's full-sized avatar
🤖

Sebastián Cruz sebacruz

🤖
View GitHub Profile
@sebacruz
sebacruz / gist:b97850671010ca3f6ac2cdc5510424b6
Last active April 20, 2017 14:38
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib

Error

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib Referenced from: /Users/sebas/.phpbrew/php/php-7.0.9/bin/php Reason: image not found Abort trap: 6

Solution

$ ssh-add -D #remove existing identities
$ ssh-agent #copy the lines & run them
$ ssh-add #uses the output from above
@sebacruz
sebacruz / .bashrc
Last active November 16, 2016 20:51
[ -r /etc/bashrc ] && source /etc/bashrc
[ -r /etc/bash_completion ] && source /etc/bash_completion
[ -r ~/.git-completion.bash ] && source ~/.git-completion.bash
[ -r ~/.git-prompt.sh ] && source ~/.git-prompt.sh
[ -r /usr/local/rvm/scripts/rvm ] && source /usr/local/rvm/scripts/rvm
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing up a
# separate process
test -d "$1" && return 0;

Keybase proof

I hereby claim:

  • I am sebacruz on github.
  • I am cruz (https://keybase.io/cruz) on keybase.
  • I have a public key ASCNw37TXnd-e5E54mrLFFfE_2s88iClIl73PQjSP42M5go

To claim this, I am signing this object:

@sebacruz
sebacruz / roles_invesitgation.md
Created June 13, 2016 14:04 — forked from facultymatt/roles_invesitgation.md
Roles and permissions system for Nodejs
@sebacruz
sebacruz / nginx.conf
Created June 1, 2016 04:02 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
<?php
class ColorGenerator {
private static $startColor;
private static $endColor;
private static $steps;
private static $colors;
private static function interpolate(
// ...
namespace :deploy do
task :upload_assets, :roles => :web do
capifony_pretty_print "--> Uploading compiled assets"
run_locally "gulp build --production --disable-fail"
run "mkdir -p #{release_path}/#{assets_folder}"
top.upload assets_folder, "#{release_path}/#{web_path}".to_s, {:via => :scp, :recursive => true}
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
<?php
function parse_signed_request($signed_request) {
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
// decode the data
$sig = base64_url_decode($encoded_sig);
$data = json_decode(base64_url_decode($payload), TRUE);
// confirm the signature
$expected_sig = hash_hmac('sha256', $payload, $secret, $raw = TRUE);