Skip to content

Instantly share code, notes, and snippets.

View danigosa's full-sized avatar
🎯
24/7 Coding Whore

danius danigosa

🎯
24/7 Coding Whore
  • Robbie AI Inc.
  • Boston
View GitHub Profile
@listnukira
listnukira / get_ip_v1.c
Last active March 18, 2023 16:58
use getsockname to get ip and port
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define SERVER_ADDR "172.217.160.99"
#define SERVER_PORT 80
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: