Skip to content

Instantly share code, notes, and snippets.

@pjmartorell
pjmartorell / libc++ & Clang
Created November 29, 2012 00:22
Errors trying to use libc++ with Clang 3.1 in Mac OSX 10.6 (Snow Leopard)
$ make
[100%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o
In file included from /Users/xxxxx/fantom/bin/foo/foo.cpp:1:
In file included from /Users/xxxxx/fantom/include/fantom/algorithm.hpp:10:
In file included from /usr/include/c++/v1/unordered_map:318:
In file included from /usr/include/c++/v1/__hash_table:19:
/usr/include/c++/v1/cmath:1333:9: error: no member named 'llrint' in the global namespace
using ::llrint;
~~^
/usr/include/c++/v1/cmath:1334:9: error: no member named 'llrintf' in the global namespace
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
21at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1649)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1206)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
@pjmartorell
pjmartorell / prepare-commit-msg
Created July 21, 2014 10:51
Prepend automatically a reference to the issue number to commit tasks
#!/usr/bin/env ruby
# Git commit-msg hook. Prepend a reference to the issue number of the branch name to commit tasks.
# If your branch name is in the numeric form "issue_12345", also prepend "refs #12345" to commit messages,
# unless "refs #12345" is manually provided inline.
#
# Place code into .git/hooks/prepare-commit-msg and give it executable permissions
# cd .git/hooks
# wget https://gist.github.com/pjmartorell/6456a5ffa7f7ff9d3195
# chmod 755 prepare-commit-msg
@pjmartorell
pjmartorell / RSpec.sublime-build
Created July 29, 2014 17:53
Rspec Sublime Build System
// It's saved under path_to_Packages/User/
{
"env":{
"PATH":"${HOME}/.rvm/bin:${PATH}"
},
"cmd": ["rvm-auto-ruby","-S", "bundle", "exec", "rspec", "-I ${file_path}", "$file"],
"file_regex": "# ([A-Za-z:0-9_./ ]+rb):([0-9]+)",
"working_dir": "${project_path:${folder:${file_path}}}",
"selector": "source.ruby",
@pjmartorell
pjmartorell / MapSVG.js
Last active May 6, 2016 08:50
Function to fetch the region name from the region ID in mapSVG WordPress plugin Can be used for Global tooltips or popovers
/* Function to fetch the region name from
the region ID in mapSVG WordPress plugin
Can be used for Global tooltips or popovers */
function (event, region) {
return '<b>' + region.id.replace(/_/g," "); + '</b>';
}
@pjmartorell
pjmartorell / laravel_naming.php
Last active May 5, 2016 16:47
Laravel Naming Conventions
<?php
class MyClass {
const MY_CONSTANT = 0.0;
protected $myProperty;
protected $table = [
"my_table"
@pjmartorell
pjmartorell / comm-s3.sh
Last active May 6, 2016 09:06
Find the symmetric difference between Amazon S3 object list and your local files list
#!/usr/bin/env bash
comm -13 <(aws s3 ls s3://my-bucket | awk '{print $NF}' | sort) <(ls my_local_folder/ | awk '{print $NF}' | sort)
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
@pjmartorell
pjmartorell / git-checkout.rake
Last active September 9, 2016 11:58 — forked from sunny/git-checkout.rake
Task to checkout a branch in rails and apply or rollback the migrations between the two.
# encoding: UTF-8
#
# $ rake checkout new_branch_name
#
# Via https://gist.github.com/jonlemmon/4076864
#
# 1. Roll back any migrations on your current branch which do not exist on the
# other branch
# 2. Discard any changes to the db/schema.rb file
# 3. Check out the other branch
@pjmartorell
pjmartorell / cuba_resources.md
Created June 28, 2017 09:53
Cuba framework resources and examples

Source code

Tutorials