Go Language JSON to Struct
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Ever saw a huge JSON string and wanted it as a Go Language Struct? Here’s a great tool to automagically convert that JSON to a usable struct for your golang application. https://mholt.github.io/json-to-go/ Try it out for yourself! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "user": [{ "id": 1, [...]
Secret Environment Variables with Drone
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
This is a basic tutorial on adding environment variables inside your public github repo without letting everyone know your true values. Drone will encrypt your values, and the file .drone.sec will store the encrypted variables. 1. Log into Drone and view/activate your Repo 2. Click on the “Secrets” tab. Insert your [...]
Create MySQL Database with Authentication in Golang
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Below is a nice snippet for Go Language to create a new MySQL database, and attach a new username and password to access that database. Set your database root credentials and create a new username, password and database. 1 2 3 4 5 6 7 8 9 10 11 12 // MYSQL CREDS var dbUser string = "root" var dbPass string = [...]
MySQL to Struct in Go Language
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Here’s an example of creating a new struct object from a MySQL query. The function below will fetch a user based on the userId (int) submitted. Look at the bottom of this post to see how to Fetch an array of each user in database. I have also include a MySQL dump of the Users table. User struct 1 2 3 4 5 type User struct { Id int [...]
Cloud9 IDE with Ruby on Rails in Docker
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
I’ve been using Cloud9 for quite a while, but then I wanted to run it on my own server with no extra costs. I made life easy, and created a Docker image that will install Cloud9 with Ruby on Rails. https://github.com/Hunterlong/Cloud9-Rails It’s pretty simple to use, just run the docker image with a couple of enviroment [...]
Auto Connect Rancher Hosts
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
This script was extremely useful for me, you would run this script on a new host for your rancher server. It will automatically connect to the rancher server, and add it as a node. This script will automatically install Docker (for ubuntu-trusty) and add host in your rancher server. Script for Ubuntu 14.04 (trusty) 1 2 3 4 5 6 7 8 9 10 [...]
Sending Emails in Go using SimpleMailer
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
I have been working on a Go Language package called SimpleMailer that allows variables to be injected into the HTML template of an email. It uses {{VAR}} and replaces with a string. Go Get the package 1 go get github.com/hunterlong/simplemailergo get github.com/hunterlong/simplemailer Import the package in your application 1 import [...]
HTTP Handler Testing in Go Language
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
This is a short snippet for your Go Language tests that need the response of a http server handler while POST-ing form value to handler. The function will check if body of response includes the string of your choice. Hander 1 2 3 func ShowIndexHandler(w http.ResponseWriter, r *http.Request) { }func ShowIndexHandler(w [...]
Scale Down an Iframe
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/www/phpsites/public/yayprogramming/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Recently I had to make a minimized version of an iframe. It shows the website with the correct CSS, but just smaller. With CSS3 transforms you can scale down (or up) an iframe for a preview type of iframe. HTML iframe 1 <iframe class="miniiframe" src="http://yayprogramming.com"></iframe><iframe [...]
UnityScript to C# Converter
Some people that use Unity3D only program with UnityScript, also known as Javascript. Javascript in Unity3D is a hassle for me, I recommend you start using C#, you’ll type less, and it’s just better overall. Javascript and C# are pretty similar, but creating variables is different. For those of you who see a Unity3d script in [...]