Skip to content

Instantly share code, notes, and snippets.

@codearryaas
codearryaas / detect-ios.js
Created November 17, 2019 17:00
JavaScript: How to detect if device is iOS?
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIOS) {
console.log('This is a IOS device');
} else {
console.log('This is Not a IOS device');
}
@itsjusteileen
itsjusteileen / functions.php
Created January 15, 2020 21:05
Lists all SSP plugin podcast custom post type on the home page
<?php
/*
Plugin Name: SSP Customizations
Plugin URI: https://github.com/TheCraigHewitt/Seriously-Simple-Podcasting
Description: Customizations for the Seriously Simple Podcasting Plugin
Version: .1
Author: itsjusteileen
Author URI: https://github.com/itsjusteileen
*/
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
@mrmartineau
mrmartineau / HowToTest.md
Created March 28, 2020 23:16 — forked from tkrotoff/HowToTest.md
How I structure my tests

File structure

  • src/fooBar.js
  • src/fooBar.html
  • src/fooBar.scss
  • src/fooBar....
  • src/fooBar.test.js => npm run test
  • src/fooBar.test.e2e.js (if I have E2E tests - Puppeteer, Playwright...) => npm run test:e2e

Tests should not be separated from the source code (think autonomous modules).

@rachids
rachids / settings.json
Last active August 13, 2024 16:16
Integrate Laragon's terminal (CMDer) to Visual Studio Code
{
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
@bhaveshxrawat
bhaveshxrawat / index.html
Last active March 1, 2024 16:21
Intersection Observer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Intersection Observer</title>
<link rel="stylesheet" href="style.css">
<script defer src="script.js"></script>
</head>
<body>