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 (
use App\Image as Img;
use Intervention\Image\Facades\Image;
/**
* With Image Resizing
*/
if($request->hasFile('filename')){
$img = $request->file('filename');
$request->filename = time() . '.' . $img->getClientOriginalExtension();
@danmaina
danmaina / index.html
Created June 13, 2017 09:08
Content Slider
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Content Slider</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<h1 class="page-title">Content Slider</h1>
@danmaina
danmaina / index.html
Created June 10, 2017 19:23
html css javascript Practice. Dependent on jquery
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simpe Quiz</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body id="container">
<h1 class="page-title">Simple javascript Quiz</h1>
@danmaina
danmaina / dialog.cpp
Last active January 14, 2018 13:13
Quick Qtwidget application connect to Mysql database
#include "dialog.h"
#include "ui_dialog.h"
#include <iostream>
#include <QSqlDriver>
#include <QSqlDatabase>
#include <QtSql>
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)