Skip to content

Instantly share code, notes, and snippets.

View lewis-munyi's full-sized avatar

Lewis Munyi lewis-munyi

View GitHub Profile
@lewis-munyi
lewis-munyi / app.py
Last active April 29, 2021 12:25
Enable file name Case sensitivity for Windows [Python script]
# Recommended: Run file as administrator
import os
import time
start = time.time()
pwd = os.getcwd()
y = 0
for x in os.walk("."):
@lewis-munyi
lewis-munyi / gist:6605d7966f74ec6708b18e0c38fbad5b
Created February 19, 2021 16:52 — forked from metaskills/gist:893599
A Copy Of sp_MSforeachtable Stored Procedure For Azure, Uses sp_MSforeach_worker
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
@lewis-munyi
lewis-munyi / deployment_guide.md
Created January 15, 2021 20:03 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel
@lewis-munyi
lewis-munyi / index.js
Created May 28, 2020 12:32
Web scraping - Create datasets with Javascript
// Run npm install puppeteer colors axios cli-progress
// Run `node index.js`
const puppeteer = require('puppeteer');
const fs = require('fs');
const axios = require('axios');
const colors = require('colors');
const cliProgress = require('cli-progress');
@lewis-munyi
lewis-munyi / Resume.md
Last active April 21, 2020 22:22
Resume

Lewis Munyi

Software Developer

[ Website ] . [ Email ] . [ LinkedIn ]

Education

BSc. Computer Science, University of Nairobi (2015-2019)

@lewis-munyi
lewis-munyi / javascript.json
Last active November 19, 2025 19:23
VS code Try-catch snippet
{
"Stackoverflow Try-Catch": {
"prefix": "trycatch",
"body": [
"try{",
" ${1:// Something}",
"} catch(error) {",
" ${2:console.error('Exception ' + error);",
" ${3:window.open('https://stackoverflow.com/search?q=[js]' + error.message, '_blank');}}",
"}",
@lewis-munyi
lewis-munyi / pwa.md
Created May 3, 2018 09:17
PWA essentials

PWA essentials

All the things needed from service workers to manifests and opengraph descriptions

  • Copy this code into your app.js to install the service worker:
if ('serviceWorker' in navigator) {  //Check if browser supports service workers
    window.addEventListener('load', function () {
@lewis-munyi
lewis-munyi / map-maker.html
Created May 3, 2018 09:15
A snippet that gets a map location and shows it in a div
<html>
<head>
<!-- Bootstrap links -->
</head>
<body>
<div class="col-xs-12 col-md-12 col-lg-12 gmap_canvas_height">
<div id="gmap_canvas" style="height:500px;width:100%;"></div>
</div>
<script type="text/javascript">
function init_map() {