Skip to content

Instantly share code, notes, and snippets.

View danmaina's full-sized avatar
🎯
Focusing

Maina Dan danmaina

🎯
Focusing
View GitHub Profile
@danmaina
danmaina / gist:1b49a94dbcfef76f22b213d346223cf9
Created October 18, 2018 12:48 — forked from sminnee/gist:1598600
A PHP script to find the closest subset of a list of numbers that sums to a given value.
<?php
$numbers = array(
-750,
-781.92,
-2000,
-450,
-1000,
-1136.16,
-75.6,
@danmaina
danmaina / etc-init.d-hello-world
Created September 3, 2018 12:13 — forked from josephspurrier/etc-init.d-hello-world
/etc/init.d Script for Go Application
#!/bin/bash
#
# chkconfig: 35 95 05
# description: Hello world application.
# Run at startup: sudo chkconfig hello-world on
# Load functions from library
. /etc/init.d/functions
@danmaina
danmaina / db.go
Created August 10, 2018 16:06 — forked from SchumacherFM/db.go
GoLang Database SQL: Selecting an unknown amount of columns from a query. Benchmark results in db_test.go
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"log"
)
const (