Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"log"
"net"
"net/http"
maxminddb "github.com/oschwald/maxminddb-golang"
)
#!/usr/bin/env perl
use strict;
use warnings;
use Text::CSV_XS;
use Net::Works::Network;
use MaxMind::DB::Writer::Tree;
my %types = (
service => 'utf8_string',
package main
import (
"encoding/csv"
"encoding/json"
"io/ioutil"
"net/http"
"os"
)
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new macOS machine
#
# bash <(curl -L <gist>)
#
# Based on https://gist.github.com/codeinthehole/26b37efa67041e1307db
#
echo "Starting bootstrapping"
#include <iostream>
using namespace std;
void reverse_r(char* s, int a, int b) {
if (a < b) {
char tmp = s[a];
s[a] = s[b];
s[b] = tmp;
reverse_r(s, a+1, b-1);
}
#include <iostream>
using namespace std;
void pointerSort(int arr[], int size, int**& pointers) {
pointers = new int*[size];
for (int i = 0; i < size; ++i)
pointers[i] = &arr[i];
for (int i = 0; i < size - 1; ++i) {
for (int j = i + 1; j < size; ++j) {
int main() {
printf("hi\n");
return 0;
}
path = getenv("PATH");
if (path != NULL) {
path = strdup(path);
for (dir = strtok(path, ":"); dir != NULL; dir = strtok(NULL, ":")) {
strcpy(candidate, dir);
strcat(candidate, "/");
strcat(candidate, argv[0]);
if (access(candidate, X_OK) == 0) {
printf("executable is '%s' (from PATH).\n", candidate);
return 0;