Skip to content

Instantly share code, notes, and snippets.

View peterson-umoke's full-sized avatar
🏠
Working from home, Freelancer, Software Engineer

Peterson Umoke peterson-umoke

🏠
Working from home, Freelancer, Software Engineer
View GitHub Profile
@peterson-umoke
peterson-umoke / Simple Genericons social-menu with scss
Created August 20, 2016 17:29
This is the easiest way of creating a social menu, making sure to link the genericons font by wordpress. main link : "https://cdn.jsdelivr.net/genericons/3.4.1/genericons.css"
.social-links ul a:before {
font-family: "Genericons";
font-size: 20px !important;
font-style: normal;
font-weight: normal;
line-height: 1;
text-decoration: none;
vertical-align: text-bottom;
-webkit-font-smoothing: antialiased;
}
@peterson-umoke
peterson-umoke / Removing the Public path from laravel url
Last active July 26, 2018 13:33
How to remove the public path from laravel when using a shared server
We all know how painful it is to setup a beautiful application and then just discover that it sucks once it lands in your shared server. Here is how you can remove that annoying that annoying 'public' url path in your laravel application
1. change server.php in your root folder to index.php , no modifications pls
2. create a .htaccess file in your root folder
3. paste the code below
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
@peterson-umoke
peterson-umoke / help.jsx
Last active March 5, 2019 07:54
Need help getting the data into a serialized format
<GridRow reset>
<GridColumn col='half'>
<div className='form-group'>
<select
name='document_type[]'
id='document_type'
required
>
<option value=''>Document Type</option>
<option value'britain'> Britain </option>
@peterson-umoke
peterson-umoke / hiddenInput.js
Created June 13, 2019 10:47
This code snippet is used to check for the value change of a hidden input field
var hiddenFieldID = $("#ins_appraisal_ins_appraisal_settingsins_appraisal_settings_idb");
var oldValueField = hiddenFieldID.val();
setInterval(function() {
if (oldValueField !== hiddenFieldID.val()) {
oldValueField = hiddenFieldID.val();
hiddenFieldID.val(oldValueField).trigger('change');
}
}, 1000);
$(hiddenFieldID).change(function() {
console.log('lkljsdf', $(this).val());
@peterson-umoke
peterson-umoke / view.blade.php
Created January 22, 2020 20:27
how to use modal inside laravel view template
@php
$users2 = DB::select('select * from users where active = ?', [1]); // user raw sql and prepared statements
$users1 = DB::table('users')->get(); // using query builder
@endphp
dd($users1)
dd($users2)
@peterson-umoke
peterson-umoke / IntelIJTrialReset.bat
Created February 17, 2020 10:40
How to Reset InteIIiJ IDEA Evaluation Key in Windows
cd "C:%HOMEPATH%\.IntelliJIdea*\config"
rmdir "eval" /s /q
del "options\other.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
:: This will work for idea 2018.3 and later
::
:: It is Highly Advised to Purchase the JetBrain Softwares
:: This is only for the case You just want to Extend the
:: Trial Period and Evaluate the IDE for some more Time
const statesInNigeria = [
{
state: "ABIA",
lga: ["AROCHUKWU", "INI ", "OBI NGWA", "UGWUNAGBO", "UKWA EAST "],
},
{
state: "ADAMAWA",
lga: [
"DEMSA",
"FUFORE",
@peterson-umoke
peterson-umoke / countdown.js
Created July 26, 2020 19:10
Use to get timezone diff with solutions
<!-- Display the countdown timer in an element -->
<p id="demo"></p>
<script>
// Set the date we're counting down to
var localTime = new Date("Jan 5, 2021 15:37:25").getTime();
// convert the time to the current timezone
var localOffset = new Date("Jan 5, 2021 15:37:25").d.getTimezoneOffset() * 60000;
@peterson-umoke
peterson-umoke / sql2excel.php
Created August 17, 2020 17:07
export sql results to excel
<?php
/*******EDIT LINES 3-8*******/
$DB_Server = "localhost"; //MySQL Server
$DB_Username = "root"; //MySQL Username
$DB_Password = ""; //MySQL Password
$DB_DBName = "backoffice"; //MySQL Database Name
$filename = "excelfilename"; //File Name
/*******YOU DO NOT NEED TO EDIT ANYTHING BELOW THIS LINE*******/
//create MySQL connection
$sql = 'Select * from $DB_TBLName';
@peterson-umoke
peterson-umoke / e-shop.py
Last active June 3, 2021 02:18
Just a simple python program to create and use a shopping cart
# set the items the store sells
shopItems = [
{
"item": "Beans",
"price": 1000,
},
{
"item": "Rice",
"price": 200,
},