- Like C, but with garbage collection, memory safety, and special mechanisms for concurrency
- Pointers but no pointer arithmetic
- No header files
- Simple, clean syntax
- Very fast native compilation (about as quick to edit code and restart as a dynamic language)
- Easy-to-distribute executables
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
func ConvertStructToMap(st interface{}) map[string]interface{} { | |
reqRules := make(map[string]interface{}) | |
v := reflect.ValueOf(st) | |
t := reflect.TypeOf(st) | |
for i := 0; i < v.NumField(); i++ { | |
key := strings.ToLower(t.Field(i).Name) | |
typ := v.FieldByName(t.Field(i).Name).Kind().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
# These examples assume you have a container currently running. | |
# 1 Pipe from a file | |
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt` | |
#2a Pipe by piping | |
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash - |
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
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sh -c 'echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list' | |
# Install docker | |
sudo apt-get update | |
sudo apt-get purge lxc-docker | |
sudo apt-get install linux-image-extra-$(uname -r) | |
sudo apt-get install docker-engine | |
sudo service docker start |
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
/** | |
* Changes XML to JSON | |
* Modified version from here: http://davidwalsh.name/convert-xml-json | |
* @param {string} xml XML DOM tree | |
*/ | |
function xmlToJson(xml) { | |
// Create the return object | |
var obj = {}; | |
if (xml.nodeType == 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
/** | |
* This are a collection of examples for C 201. | |
* These combine concepts you may or may not be | |
* familiar with and are especially useful for | |
* students new to C. There is a lot of really | |
* cool stuff you can do in C without any cool | |
* languages. | |
* | |
* This is file in particular is an introduction | |
* to fun function usage in C. |
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
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.blobUtil=e():"undefined"!=typeof global?global.blobUtil=e():"undefined"!=typeof self&&(self.blobUtil=e())}(function(){return function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t){"use strict";function n(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=-1;++o<t;)r[o]=e.charCodeAt(o);return n}function r(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=-1;++o<r;)t+=String.fromCharCode(n[o]);return t}function o(e,t){return new L(function(n,r){var o=new Image;t&&(o.crossOrigin=t),o.onload=function( |
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
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding | |
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding |
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
/** | |
* Copyright 2012 Akseli Palén. | |
* Created 2012-07-15. | |
* Licensed under the MIT license. | |
* | |
* <license> | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files | |
* (the "Software"), to deal in the Software without restriction, | |
* including without limitation the rights to use, copy, modify, merge, |
NewerOlder