Skip to content

Instantly share code, notes, and snippets.

View wmucheru's full-sized avatar
💭
AI?

wmucheru

💭
AI?
View GitHub Profile
@wmucheru
wmucheru / index.html
Created October 2, 2024 07:22
Invoice Design
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Order confirmation </title>
<meta name="robots" content="noindex,nofollow" />
<meta name="viewport" content="width=device-width; initial-scale=1.0;" />
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
body { margin: 0; padding: 0; background: #e1e1e1; }
div, p, a, li, td { -webkit-text-size-adjust: none; }
.ReadMsgBody { width: 100%; background-color: #ffffff; }
@wmucheru
wmucheru / index.html
Created October 2, 2024 07:21
Invoice Template
<div id="invoiceholder">
<div id="headerimage"></div>
<div id="invoice" class="effect2">
<div id="invoice-top">
<div class="logo"></div>
<div class="info">
<h2>Michael Truong</h2>
<p> [email protected] </br>
@wmucheru
wmucheru / sort.js
Created October 26, 2022 12:25
Sort objects in array using boolean and string fields
const sortItems = () => {
const items = [
{
id: 1,
name: "Onion",
checked: true,
},
{
id: 2,
name: "Paper",
# Compound interest: https://www.youtube.com/watch?v=P182Abv3fOk
# A = P(1 + r/n)tN
def compound(principle, interest, time, annual = True):
interest_percent = interest / 100
amount_annual = principle * (1 + interest_percent) ** time
amount_monthly = principle * (1 + (interest_percent / 12)) ** (time * 12)
return amount_annual if annual else amount_monthly
@wmucheru
wmucheru / upload-preview.html
Created April 14, 2021 11:38
Upload and crop using CropperJS & VueJS
<link rel="stylesheet" href="cropper.min.css">
<div>
<div v-if="uploadError" class="alert alert-danger">{{ uploadError }}</div>
<label class="upload-label btn btn-sm btn-default">
Browse...
<input type="file" accept="image/*" v-on:change="previewCropUpload" multiple />
</label>
@wmucheru
wmucheru / angled-edge-pseudo-element-sass-mixin.markdown
Created November 26, 2019 11:34
Angled Edge Pseudo Element SASS Mixin
@wmucheru
wmucheru / DownloadActivity.java
Created September 6, 2018 13:19
Using DownloadManager to download files in Android
package app.test;
import android.app.Activity;
import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
@wmucheru
wmucheru / form.html
Last active March 26, 2018 17:07
Send email with headers (Prevents going to spam)
<form class="form-horizontal col-md-10 cform" id="cform">
<div class="form-group">
<label class="control-label">Name*</label>
<input type="text" class="form-control" name="name" required />
</div>
<div class="form-group">
<label class="control-label">E-mail Address*</label>
<input type="email" class="form-control" name="email" required/>
</div>
<div class="form-group">
@wmucheru
wmucheru / acccessRedusStore.js
Created January 25, 2018 12:23
Accessing Redux Store outside a component
// tooling modules
import axios from 'axios'
// store
import store from '../store'
store.subscribe(listener);
function select(state) {
return state.auth.tokens.authentication_token
}
@wmucheru
wmucheru / countries.geo.json
Last active January 23, 2018 10:23
Leaflet Countries GeoJSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.