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 example | |
import ( | |
"testing" | |
"net/http/httptest" | |
"net/http" | |
"fmt" | |
"io/ioutil" | |
) |
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 ( | |
"crypto/hmac" | |
"time" | |
"strconv" | |
"fmt" | |
"net/http" | |
"io/ioutil" | |
"crypto/sha512" |
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
TITLE=My Title | |
BUNDLE_ID=com.rheinardkorf | |
PROJECT=MyApp | |
EXEC=app | |
VERSION=0.1 | |
define plist | |
<?xml version="1.0" encoding="UTF-8"?> \ | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.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
package snakeymap | |
func SnakeKeyMap(data map[string]interface{}) map[string]interface{} { | |
converted := make(map[string]interface{}) | |
for key, val := range data { | |
goodKey := snakeKey(key) | |
switch v := val.(type) { | |
case map[string]interface{}: |
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
# Get and make mongodb PHP driver | |
RUN yes | apt-get install libssl-dev \ | |
&& git clone https://github.com/mongodb/mongo-php-driver.git --recursive \ | |
&& cd mongo-php-driver \ | |
&& phpize \ | |
&& ./configure --with-mongodb-ssl=openssl \ | |
&& make all \ | |
&& make install \ | |
&& echo "extension=mongodb.so" > /opt/php${SHORT_VERSION}/lib/conf.d/ext-mongodb.ini \ | |
&& cd .. \ |
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
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Demo</title> | |
<script src="https://media-library.cloudinary.com/global/all.js"></script> | |
<script type="text/javascript"> | |
const mloptions = { | |
cloud_name: '<CHANGE_THIS>', | |
api_key: '<CHANGE_THIS>', |
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
<?php | |
/** | |
* Validate Slack notification signature. | |
* | |
* @see https://api.slack.com/docs/verifying-requests-from-slack | |
* | |
* @param array $headers POST headers. | |
* @param string $response_body JSON string of body. | |
* @param string $signing_secret Slack secret. |
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
<?php | |
class DockerManager { | |
/** | |
* This is where the magic happens. | |
* The Docker Engine socket needs to be mounted in docker-compose.yml. | |
* | |
* volumes: | |
* - /var/run/docker.sock:/var/run/docker.sock |
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
# Install `dnsmasq` and configure for *.dev domains | |
$ brew install dnsmasq | |
$ vim /usr/local/etc/dnsmasq.conf | |
# Reload configuration and clear cache | |
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
$ dscacheutil -flushcache |
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
exports.withThemePath = (relativePath, root = __dirname) => { | |
const qualifiedPath = relativePath.replace('./src', `${root}/src`); | |
let qualifiedResolvedPath = path.resolve(qualifiedPath); | |
let finalPath = qualifiedResolvedPath; | |
const theme = path.basename(root); | |
const themedPath = relativePath.replace('./src', `./src/${theme}`); | |
let themedResolvedPath = path.resolve(themedPath); | |
try { |