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" | |
"math" | |
) | |
func parent(i int) int { | |
return (i - 1) / 2 | |
} |
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
# A small set of commands to do basic server setup | |
# First and foremost add password to root | |
sudo passwd root | |
# Update the dist | |
sudo apt-get update && sudo apt-get upgrade | |
# Block rogue connections by | |
# allowing only ssh, port - 80, 443 | |
# using Uncomplicated Firewall (ufw) |
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
// Traverses an arbitrary struct and translates all stings it encounters | |
// | |
// I haven't seen an example for reflection traversing an arbitrary struct, so | |
// I want to share this with you. If you encounter any bugs or want to see | |
// another example please comment. | |
// | |
// The MIT License (MIT) | |
// | |
// Copyright (c) 2014 Heye Vöcking | |
// |
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
'use strict'; | |
angular.module('cafeApp') | |
.directive('inspect', function($timeout, $http) { | |
Element.prototype.serializeWithStyles = (function () { | |
var defaultStylesByTagName = {}; | |
var noStyleTags = {'BASE':true,'HEAD':true,'HTML':true,'META':true,'NOFRAME':true,'NOSCRIPT':true,'PARAM':true,'SCRIPT':true,'STYLE':true,'TITLE':true}; |