Skip to content

Instantly share code, notes, and snippets.

View katsisaac50's full-sized avatar

katsisaac50

View GitHub Profile
@katsisaac50
katsisaac50 / media-query.css
Created December 13, 2019 19:08 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@katsisaac50
katsisaac50 / string_search.js
Created July 13, 2019 05:22 — forked from amoilanen/string_search.js
Rabin-Karp Algorithm for Searching Strings Implemented in JavaScript
function simpleSearch(text, str) {
var matches = [];
for (var i = 0; i <= text.length; i++) {
if (matchesAtIndex(i, text, str)) {
matches.push(i);
}
}
return matches;
}
@katsisaac50
katsisaac50 / how-to-create-a-read-only-user-for-your-database.md
Created March 20, 2019 10:31 — forked from nepsilon/how-to-create-a-read-only-user-for-your-database.md
How to create a read-only user for your database? — First published in fullweb.io issue #97

How to create a read-only user for your database?

If your app is about searching (business directories, dictionaries, etc) or a catalog of browsable items, it’s always a good idea to let your API use a read-only database user. Another use case would be for doing backups, no write permissions needed either.

Here is how to do that for PostgreSQL v9.0+ (syntax quasi-similar for MySQL):

-- Say we just created the user "pouet"

-- Allow the user to CONNECT
GRANT CONNECT ON DATABASE mydb TO pouet;
@katsisaac50
katsisaac50 / quotes.json
Created January 2, 2019 15:14 — forked from camperbot/quotes.json
Quotes List in JSON Format
{
"quotes": [
{
"quote":"Life isn’t about getting and having, it’s about giving and being.","author":"Kevin Kruse"},
{
"quote":"Whatever the mind of man can conceive and believe, it can achieve.","author":"Napoleon Hill"},
{
"quote":"Strive not to be a success, but rather to be of value.","author":"Albert Einstein"},
{
@katsisaac50
katsisaac50 / README.md
Created July 10, 2018 11:09 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
<div id="root">
<!-- This div's content will be managed by React. -->
</div>
@katsisaac50
katsisaac50 / javascript-falsy.js
Created April 30, 2018 22:07 — forked from yangsu/javascript-falsy.js
JavaScript Falsy Values
'0' == false // true
'0' == 0 // true
!!'0' // true
!!0 || !!'' || !!"" || !!null || !!undefined || !!false || !!NaN // false
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">