Skip to content

Instantly share code, notes, and snippets.

View achingachris's full-sized avatar
✈️
Flight24

C A achingachris

✈️
Flight24
View GitHub Profile
@achingachris
achingachris / filter.js
Created May 31, 2020 17:12
JavaScript Arrays & Methos
// filter() creates a new array from an existing array with all elements that have passed a test/condition given.
// syntax for .filte()
// let newArray = oldArray.filter()
// example 1
const countries = ['kenya', 'uganda', 'tanzania', 'somalia', 'burundi', 'rwanda', 'egypt']
let newCountries = countries.filter(country => country.length > 6)
console.log(newCountries) // will create a new array of countries whose name have a length of 7 chracters and above
@achingachris
achingachris / devcquestarrays.js
Last active October 15, 2020 03:23
Tech Questions Array
const students = [
{ name: "Irene", yearStarted: 2015, yearCompleted: 2019 },
{ name: "Jamila", yearStarted: 2019, yearCompleted: 2020 },
{ name: "Swabra", yearStarted: 2018, yearCompleted: 2022 },
{ name: "Ali", yearStarted: 2000, yearCompleted: 2007 },
{ name: "Chris", yearStarted: 2001, yearCompleted: 2006 },
{ name: "Ken", yearStarted: 2020, yearCompleted: 2024 },
{ name: "Shantel", yearStarted: 2015, yearCompleted: 2021 },
{ name: "Martin", yearStarted: 2018, yearCompleted: 2020 },
{ name: "Salma", yearStarted: 2015, yearCompleted: 2019 },
@achingachris
achingachris / index.html
Created February 5, 2021 10:55
Parallax Hero Image
<div class="cd-background-wrapper">
<figure class="cd-floating-background">
<img src="https://codyhouse.co/demo/parallax-hero-image/img/cd-img-1.jpg" alt="image-1">
<img src="https://codyhouse.co/demo/parallax-hero-image/img/cd-img-2.png" alt="image-2">
<img src="https://codyhouse.co/demo/parallax-hero-image/img/cd-img-3.png" alt="image-3">
</figure>
</div>
@achingachris
achingachris / .gitignore
Created February 13, 2021 14:50
Django Git Ignore
# Created by https://www.toptal.com/developers/gitignore/api/django
# Edit at https://www.toptal.com/developers/gitignore?templates=django
### Django ###
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
const students = [
{ name: "Irene", yearStarted: 2015, yearCompleted: 2019 },
{ name: "Jamila", yearStarted: 2019, yearCompleted: 2020 },
{ name: "Swabra", yearStarted: 2018, yearCompleted: 2022 },
{ name: "Ali", yearStarted: 2000, yearCompleted: 2007 },
{ name: "Chris", yearStarted: 2001, yearCompleted: 2006 },
{ name: "Ken", yearStarted: 2020, yearCompleted: 2024 },
{ name: "Shantel", yearStarted: 2015, yearCompleted: 2021 },
{ name: "Martin", yearStarted: 2018, yearCompleted: 2020 },
{ name: "Salma", yearStarted: 2015, yearCompleted: 2019 },
@achingachris
achingachris / index.js
Created August 8, 2021 15:26
Using Bootstrap in NextJS with Head and Script components from NextJS
import Head from 'next/head'
import Script from 'next/script'
const index = () => {
return (
<Head>
<link
rel='stylesheet'
href='https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css'
referrerPolicy='no-referrer'
@achingachris
achingachris / wp_config.php
Last active February 8, 2022 09:01
WordPress Configuration Sample File
<?php
// some code above
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'hashnode' );
/** Database username */
define( 'DB_USER', 'root' );
import Head from 'next/head'
import Image from 'next/image'
export default function Home() {
const image_list = [
{
id: 989,
name: 'piano with brand text',
url: 'https://res.cloudinary.com/demo/image/upload/piano.jpg',
},
const image_list = [
{
id: 989,
name: 'piano with brand text',
url: 'https://res.cloudinary.com/demo/image/upload/piano.jpg',
},
{
id: 990,
name: 'piano with blurred brand text',
url: 'https://res.cloudinary.com/demo/image/upload/e_pixelate_region:20,g_ocr_text/piano.jpg',
<iframe
width={425}
height={350}
frameBorder={0}
scrolling='no'
marginHeight={0}
marginWidth={0}
src='https://www.openstreetmap.org/export/embed.html?bbox=39.65978622436524%2C-4.026432632626822%2C39.72553253173829%2C-3.976686573946468&layer=mapnik'
style={{ border: '1px solid black' }}
/>