Skip to content

Instantly share code, notes, and snippets.

View johngibb's full-sized avatar

John Gibb johngibb

View GitHub Profile
@johngibb
johngibb / pdc.md
Created October 29, 2018 17:53
Playa del Carmen

Playa del Carmen

Hope you guys have a great time! Foursquare was super helpful, so don't be a slave to this list; definitely Foursquare your away around. But don't miss El Fogon and Los Hijos de la Tostada.

Beside the specific recommendations below, you should spend a lot of time just walking up and down 5th Avenue (Calle Quinta Avenida); it's pedestrians only and where most of the spots are. We found the whole area to be safe, so feel free to explore.

You might want to spend an afternoon visiting one of the cenotes (the partially underwater caves), too. They're really pretty to just swim around it. The one we went to was by Tulum, so pretty far from PdC, but I think there are a bunch near Playa del Carmen if you just look on [tripadvisor](https://www.tripadvisor.com/Search?geo=150812&searchNearby=&pid=3826&redirect=&startTime=1540834269706&uiOrigin=MASTHEAD&q=cenote&supportedSearchTypes=find_near_stand_alone_query&enableNearPage=true&returnTo=__2F__Attractions__2D__g150812__2D__Activities__2D__Playa__5F

@johngibb
johngibb / recs.md
Last active February 7, 2018 10:52
West Village Valentine Restaurant Recommendations

4 Charles Prime Rib

$$$$. Steak House. where we went on our wedding night. On resy, but hard to get into. Could try emailing contact@nycprimerib.com.

Carbone

$$$$. Traditional Italian. Expensive but really good. I'm sure we've talked about it. Also hard to get into but worth it if you can.

var count = 0;
for (var i = 0; i < 5; i++) {
for (var j = 0; j < 5; j++) {
for (var k = 0; k < 5; k++) {
if (
i == 0 || i == 4 ||
j == 0 || j == 4 ||
k == 0 || k == 4
) {
count++;
#include <stdio.h>
int collatzLength(long n) {
if (n <= 1) {
return 1;
}
int steps = 0;
while (n > 1) {
n = (n%2==0) ? n/2 : 3*n + 1;
steps++;
SET STATISTICS TIME OFF
SET STATISTICS IO OFF
SET NOCOUNT ON
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.MyTable') AND type in (N'U'))
DROP TABLE dbo.MyTable
GO
@johngibb
johngibb / install-git-completion.sh
Last active August 10, 2022 04:42
Mac OS X - Install Git Completion
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@johngibb
johngibb / gist:960024
Created May 6, 2011 23:49
Explain Outer Apply
-- These two statements are 100% identical
select *
from Table1 t1
left join Table2 t2
on t1.id = t2.id;
select *
with LatestComments as (
select
c1.ClaimNumber
, commentClaimId = c2.ClaimNumber
, co.PV_Message
, co.PV_ComlogDate
, rn = row_number() over (partition by c1.ClaimNumber order by co.PV_ComlogDate desc)
from tbl_Accounts_Charges c1
join tbl_Accounts_Charges c2
on c2.AccountNumber = c1.AccountNumber
@johngibb
johngibb / gist:855992
Created March 5, 2011 00:56
Faceback Omniauth Callback
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
# You need to implement the method below in your model
@user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user)
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
sign_in_and_redirect @user, :event => :authentication
else
session["devise.facebook_data"] = env["omniauth.auth"]