Skip to content

Instantly share code, notes, and snippets.

View bogere's full-sized avatar
🎯
Focusing

Bogere Goldsoft bogere

🎯
Focusing
View GitHub Profile
@bogere
bogere / wp-db.tutorial.php
Created January 23, 2020 07:32 — forked from benbalter/wp-db.tutorial.php
WordPress DB Tutorial
<?php
//absolute path to wp-load.php, or relative to this script
//e.g., ../wp-core/wp-load.php
include( 'trunk/wp-load.php' );
//grab the WPDB database object, using WP's database
//more info: http://codex.wordpress.org/Class_Reference/wpdb
global $wpdb;
@bogere
bogere / .vb
Created February 7, 2019 15:35
Clinic master
Imports System.Data
Imports System.Data.SqlClient ' Reference to the ADO.NET namespace(interact with the database)
Public Class Form1
'Create ADO.NET objects.
Private myConn As SqlConnection = New SqlConnection("Data Source=GOLDSOFTX;Initial Catalog=TheBox;Integrated Security=True")
Private myCmd As SqlCommand
Private myReader As SqlDataReader
Private results As String
@bogere
bogere / gist:22a30c44c2564c269ea13b71bd941b91
Last active April 25, 2018 12:40
Interacting with firebase using nodeJS
var storage = multer.diskStorage({
destination: (req, file, cb) => {
cb(null, 'public/images/uploads')
},
filename: (req, file, cb) => {
cb(null, file.fieldname + '-' + Date.now())
}
});
var upload = multer({storage: storage});
@bogere
bogere / gist:aa89bcd321be315ec35a79799df0cba0
Created December 4, 2017 21:53 — forked from codeincontext/gist:1285806
Javascript function to show how long ago a timestamp was as a pretty string
function timeAgo(time){
var units = [
{ name: "second", limit: 60, in_seconds: 1 },
{ name: "minute", limit: 3600, in_seconds: 60 },
{ name: "hour", limit: 86400, in_seconds: 3600 },
{ name: "day", limit: 604800, in_seconds: 86400 },
{ name: "week", limit: 2629743, in_seconds: 604800 },
{ name: "month", limit: 31556926, in_seconds: 2629743 },
{ name: "year", limit: null, in_seconds: 31556926 }
];