Skip to content

Instantly share code, notes, and snippets.

View scsskid's full-sized avatar
:octocat:

Benedikt Gregor scsskid

:octocat:
View GitHub Profile
@scsskid
scsskid / css-visually-hidden.css
Created February 17, 2018 12:35
CSS: Visually hidden
.visually-hidden {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
var keepsHisWord;
keepsHisWord = true;
promise1 = new Promise(function(resolve, reject) {
if (keepsHisWord) {
resolve("The man likes to keep his word");
} else {
reject("The man doesnt want to keep his word");
}
});
console.log(promise1);
@scsskid
scsskid / README.md
Last active July 29, 2020 07:46 — forked from chuckreynolds/wordpress-change-domain-migration.sql
Wordpress Change Domain SQL Commands

Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. _STEP3: make sure your database prefix is “wp”, if it’s not then you’ll want to go through and change the prefix in each line to whatever yours is. __STEP4: copy the modified variables and the queries and paste it into phpMyAdmin or, better yet, SequelPro and run it on your database. TEST. DONE. __Changelog: — updated queries to use variables instead of editing the urls in many different areas — commented out GUID and left as optional. shouldn’t reset those. ref: codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note

@scsskid
scsskid / .htaccess
Created February 27, 2020 17:57 — forked from davemackintosh/.htaccess
Working .htaccess for Single Page Apps
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.html [QSA,L]
</ifModule>
@scsskid
scsskid / introrx.md
Created July 7, 2020 09:46 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@scsskid
scsskid / _headers
Created September 19, 2020 16:57 — forked from robsonsobral/_headers
Netlify headers
/*
# Only connect to this site and subdomains via HTTPS for the next one year
Strict-Transport-Security: max-age=31536000; includeSubDomains
# Block site from being framed with X-Frame-Options and CSP
Content-Security-Policy: frame-ancestors 'self'
# X-Frame-Options tells the browser whether you want to allow your site to be framed or not. By preventing a browser from framing your site you can defend against attacks like clickjacking.
X-Frame-Options: SAMEORIGIN
@scsskid
scsskid / Common-Currency.json
Created November 16, 2020 18:26 — forked from ksafranski/Common-Currency.json
[Common Currency Codes] in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@scsskid
scsskid / date-object-cheatsheet.js
Last active September 1, 2021 15:34 — forked from LeCoupa/date-object-cheatsheet.js
JavaScript Date Object CheatSheet | #date
// src: https://github.com/LeCoupa/awesome-cheatsheets
// Date Object CheatSheet
// The Date object is used to work with dates and times.
// More: http://www.w3schools.com/jsref/jsref_obj_date.asp
// 1. Instantiating a Date.
@scsskid
scsskid / server.js
Created December 9, 2020 15:13 — forked from bencentra/server.js
An HTTPS server for static content (Node.js)
/*
This module creates an HTTPS web server and serves static content
from a specified directory on a specified port.
To generate a new cert:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
To remove the passphrase requirement:
@scsskid
scsskid / serviceworker.js
Created December 10, 2020 11:01 — forked from kosamari/serviceworker.js
cache index.html using Service Worker
/*
* CHALLANGE:
* Cache `index.html` file using service worker.
*
* This bit of code is included in <script> tag of index.html
* if (navigator.serviceWorker) {
* navigator.serviceWorker.register('serviceworker.js', {scope: '/'})
* }
*
*/