Skip to content

Instantly share code, notes, and snippets.

View ashinzekene's full-sized avatar
🎯
Focusing

ashinzekene ashinzekene

🎯
Focusing
View GitHub Profile
@ashinzekene
ashinzekene / products.ts
Last active March 17, 2018 07:30
Products.ts file for the post - Integrating rave payments in your angular application
export const products = [
{
name: "Nokia 8",
price: 195000,
special_price: 190000,
is_new: true,
img_url: "https://drop.ndtv.com/TECH/product_database/images/8162017114310PM_635_nokia_8_back_silver.jpeg",
description: "Nokia 8 Android smartphone. Announced Sep 2017. Features 5.3″ IPS LCD display, Snapdragon 835 chipset, Dual: 13 MP primary camera, 13 MP front camera, 3090 mAh battery, 128 GB storage, 6 GB RAM, IP54 certified, Corning Gorilla Glass 5.",
rating: 5,
slug: "nokia-8"
@ashinzekene
ashinzekene / chromeEditor
Last active April 27, 2018 01:51
Use Chrome as a simple editor
data:text/html, <html contenteditable style="padding:30px;line-height:1.6;background-color:#111;color:#192;font-size: 15px;font-family:'Operator Mono',Consolas,monospace;">
@ashinzekene
ashinzekene / square.html
Created May 11, 2018 06:15
To create a square object without specifying the width and height in pixels
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.profile-image {
width: 80%;
@ashinzekene
ashinzekene / vcard_gen.py
Last active August 26, 2018 13:43
Generate a vCard(.vcf) from a csvfile
import csv
import re
from datetime import datetime
VCF_TEXT = ''
NAME_SUB = re.compile('( +|,) ?')
with open('./Final Year Bioscope Form.csv', mode='r') as csv_file:
csv_reader = csv.DictReader(csv_file)
lines_read = 0
import csv
VCF_TEXT = ''
with open('./Final Year Bioscope Form.csv', mode='r') as csv_file:
csv_reader = csv.DictReader(csv_file)
lines_read = 0
for row in csv_reader:
if lines_read > 0:
VCF_TEXT += ("BEGIN:VCARD\n"
optimization: {
splitChunks: {
name: false,
cacheGroups: {
default: false,
commons: {
test: /[\\/]node_modules[\\/]/,
name: "vendor",
chunks: "all"
}
optimization: {
splitChunks: {
name: false,
cacheGroups: {
commons: {
test: /[\\/]node_modules\/(react|react-dom|react-apollo|react-router|apollo-client)[\\/]/,
name: "vendor",
chunks: "all",
reuseExistingChunk: true
}
var (
// Match assets with hashes eg. main.347845.js, button.9029893.css
hashedPatternRegex = regexp.MustCompile(`[\w-/]\.[0-9,a-z]{20}\.(js|css)$`)
isHashedAsset = hashedPatternRegex.MatchString
)
func CacheHeaders(staticPath string) gin.HandlerFunc {
return func(c *gin.Context) {
r := c.Request.URL.Path
// Set a max age of 1-year for js and css with hashes
import React from "react";
import PropTypes from "prop-types";
import DatePicker from "react-datepicker";
import "./_custom-date-picker.scss";
export const CustomDatePicker = ({
showIcon, placeholderText, endDate, minDate, maxDate, dateFormat, selected, onChange, monthDropdown, yearDropdown
}) => (
<div className={showIcon ? "custom-date-picker custom-date-picker--show-icon" : "custom-date-picker"}>
<DatePicker
const CompressionPlugin = require('compression-webpack-plugin');
module.exports = {
plugins: [new CompressionPlugin()],
};