Skip to content

Instantly share code, notes, and snippets.

View Octagon-simon's full-sized avatar
Coding

Simon Ugorji (@Octagon) Octagon-simon

Coding
View GitHub Profile
import canvas from '@napi-rs/canvas' // For canvas.
import fs from 'fs' // For creating files for our images.
import cwebp from 'cwebp' // For converting our images to webp.
// Load in the fonts we need
GlobalFonts.registerFromPath('./fonts/Inter-ExtraBold.ttf', 'InterBold');
GlobalFonts.registerFromPath('./fonts/Inter-Medium.ttf','InterMedium');
GlobalFonts.registerFromPath('./fonts/Apple-Emoji.ttf', 'AppleEmoji');
// This function accepts 6 arguments:
@segebee
segebee / states.html
Created June 21, 2019 12:24
Nigerian States Select Drop down
<select>
<option>ABUJA FCT</option>
<option>ABIA</option>
<option>ADAMAWA</option>
<option>AKWA IBOM</option>
<option>ANAMBRA</option>
<option>BAUCHI</option>
<option>BAYELSA</option>
<option>BENUE</option>
<option>BORNO</option>
@dabit3
dabit3 / SignUp.js
Last active February 8, 2023 09:31
SignUp form in React Native Navigation - V2
// SignUp.js
import React from 'react'
import {
View,
Button,
TextInput,
StyleSheet
} from 'react-native'
export default class SignUp extends React.Component {
@gokulkrishh
gokulkrishh / media-query.css
Last active May 17, 2024 04:45
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@adamdehaven
adamdehaven / bgimage.css
Last active March 7, 2024 17:38
Bootstrap full-width hero section with text and image
.bgimage {
width:100%;
height:500px;
background: url('https://images.unsplash.com/photo-1438109491414-7198515b166b?q=80&fm=jpg&s=cbdabf7a79c087a0b060670a6d79726c');
background-repeat: no-repeat;
background-position: center;
background-size:cover;
background-attachment: fixed;
}
.bgimage h5 {
@vielhuber
vielhuber / index.php
Last active July 17, 2023 14:20
load wpdb outside in external php file #php #wordpress
<?php
// minimal version
define( 'SHORTINIT', true );
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
// medium version (With lots of overhead)
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
// full version (including functions and 200 header)
define( 'SHORTINIT', true );
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array