Skip to content

Instantly share code, notes, and snippets.

View jgmuchiri's full-sized avatar
🏠
Working from home

John Muchiri jgmuchiri

🏠
Working from home
View GitHub Profile
@jgmuchiri
jgmuchiri / stripe-firebase.css
Last active January 11, 2018 16:30
Integrating Stripe subscription with firebase authentication
.StripeElement {
background-color: white;
height: 40px;
padding: 10px 12px;
border-radius: 4px;
border: 1px solid transparent;
box-shadow: 0 1px 3px 0 #e6ebf1;
-webkit-transition: box-shadow 150ms ease;
transition: box-shadow 150ms ease;
}
function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < 5; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
@jgmuchiri
jgmuchiri / laravel-dist-cleanup.bash
Last active January 15, 2018 16:25
Laravel pre-distribution clean up and package to zip project excluding files that don't need to be shipped
#!/bin/bash
#This program automates creating a clean archive for public release of
#Laravel framework based application. For security, you will need to append .env-example to your final zip archive.
#For Windows with Ubuntu sub-system, create a .bat file called deploy.bat and append ./laravel-deploy.bash.
#Then you can click on the .bat to run deployment script.
#
# The format of the final filename is myfile-mm-dd-YYYY-v1.zip. "v1" increments to v2 and so forth in consequent runs.
#
#Target filename
@jgmuchiri
jgmuchiri / laravel-deploy.bash
Last active January 29, 2018 13:36
This program automates creating a clean archive for public release of Laravel framework based application. For security, you will need to append .env-example to your final zip archive. The format of the final filename is myfile-mm-dd-YYYY-v1.zip. "v1" increments to v2 and so forth in consequent runs. For Windows with Ubuntu sub-system, create a …
#!/bin/bash
#File: zip.bash
#Author:John Muchiri
#Date: 10-Aug-2017
#
#This program automates creating a clean archive for public release of
#Laravel framework based application. For security, you will need to append .env-example to your final zip archive.
#For Windows with Ubuntu sub-system, create a .bat file called deploy.bat and append ./laravel-deploy.bash.
#Then you can click on the .bat to run deployment script.
#
@jgmuchiri
jgmuchiri / steps.html
Last active April 13, 2018 00:45
Simple steps navigation https://snag.gy/GoFZxw.jpg
<style>
@media only screen and (min-width: 768px) {
.cd-multi-steps {
background-color: transparent;
padding: 0;
text-align: center;
}
.cd-multi-steps li {
@jgmuchiri
jgmuchiri / X-SiteImagesScrapper.vue
Last active August 28, 2018 18:04
Download images in a page - VueJS
<template>
<div>
<div class="row">
<div class="col-sm-9">
<button class="btn btn-success" v-on:click="dlImages()">
<i class="fa fa-download"></i>
Download photos
</button>
<hr/>
@jgmuchiri
jgmuchiri / My_config.php
Last active October 19, 2018 02:06
CodeIgniter load language files dynamically. User can select from dropdown menu their preferred language. Autoload this model.
<?php if(!defined('BASEPATH')) {
exit('No direct script access allowed');
}
//autoload this model
class My_config extends CI_Model
{
public function __construct()
{
$this->setLanguage();
@jgmuchiri
jgmuchiri / iFrameResizer.html
Last active January 3, 2019 21:42
Resizes iframe if window height resizes
<iframe
src="your-url-here"
id="my_iframe"
style="width: 100%;"
border="0"
margin="0" padding="0"
frameborder="0" scrolling="no" ></iframe>
@jgmuchiri
jgmuchiri / wsl-dev-env-preliquisites.sh
Last active January 29, 2019 00:39
A quick way to create a Dev env with WSL as the server for Apache and MySQL
#!/bin/bash
sudo apt-get update
sudo apt-get install apache2 mysql-server php72-cli git
sudo service apache2 start
sudo service mysql start
sudo service php7.2-fpm start
#Mailhog -optional
git clone https://github.com/mailhog/MailHog.git mailhog
@jgmuchiri
jgmuchiri / alertboxes-alerts
Last active February 2, 2019 03:13
Information blocks - alerts
<div style="width:500px; margin:0 auto">
<div class="alertbox alertbox-info">
This is an information message
</div>
<div class="alertbox alertbox-success">
We have successfully processed your request!
</div>
<div class="alertbox alertbox-warning">