Skip to content

Instantly share code, notes, and snippets.

View saldanac's full-sized avatar
👨‍💻
Focusing

Hugo Saldana saldanac

👨‍💻
Focusing
View GitHub Profile
@aligoren
aligoren / algo.md
Created March 28, 2017 12:51
👾 🍨 Diojarn, one of the simple and lightweight uptime service written in Go

Files

  • diojarn.go => Main file. It detects databases, checks URL is valid, make connection between other files.
  • database.go => Database file. It creates/deletes databases, adds columns to them.
  • ping.go => Ping file. It sends ping (ICMP) packet to target URL and returns datas like response time, response code, date, URL status (up or down)
  • server.go => Server file. It opens a web server in local network, displays websites and their data in their databases.

Algorithm

  • Main file (diojarn.go)
@mwmajew
mwmajew / gist:b4c1b12995ac939c5048df89607283cd
Created March 29, 2017 16:04
examplary output matrix task
m1 = Matrix([[1,1],[2,2]])
#
print m1
#result:
#
#| 1 1 |
#| 2 2 |
m2 = Matrix([[1,1],[1,1]])
@ranapu
ranapu / StaircaseInGo.go
Created March 30, 2017 13:22
Staircase in Go
package main
import "fmt"
func main() {
var n int
fmt.Scan(&n)
for i := 1; i <= n; i++ {
for j := 0; j < n-i; j++ {

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application

@Stumblor
Stumblor / ultimate-ut-cheat-sheet.md
Created April 19, 2017 22:06 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies