This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"net/http" | |
maxminddb "github.com/oschwald/maxminddb-golang" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/csv" | |
"encoding/json" | |
"io/ioutil" | |
"net/http" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
printf("hi\n"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |