Filter | Description | Example |
---|---|---|
allintext | Searches for occurrences of all the keywords given. | allintext:"keyword" |
intext | Searches for the occurrences of keywords all at once or one at a time. | intext:"keyword" |
inurl | Searches for a URL matching one of the keywords. | inurl:"keyword" |
allinurl | Searches for a URL matching all the keywords in the query. | allinurl:"keyword" |
intitle | Searches for occurrences of keywords in title all or one. | intitle:"keyword" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, unicode_literals | |
import django | |
import django.forms | |
import wagtail.wagtailforms.models as form_models | |
from django.db import models | |
from django.shortcuts import render | |
from django.utils.translation import ugettext_lazy as _ | |
from modelcluster.fields import ParentalKey | |
from wagtail.wagtailadmin.edit_handlers import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// routes/console.php | |
// quickly create an user via the command line | |
Artisan::command('user:create', function () { | |
$name = $this->ask('Name?'); | |
$email = $this->ask('Email?'); | |
$pwd = $this->ask('Password?'); | |
// $pwd = $this->secret('Password?'); // or use secret() to hide the password being inputted | |
\DB::table('users')->insert([ |
When it comes to databases and AWS VPC, best practice is to place your database in private subnet. By definition, private subnet in AWS is not reachable from the Internet because no Internet gateway is attached to private subnet. This is the way you protect your data. This kind of configuration is good for security but bad for data management.
How can you easily access and manage your secured data?
There are two basic ways to acees it.
- Access postgres RDS from bastion host. There are following requirements for this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import difflib | |
print("Levenshtein distance implementation !") | |
_str = 'appel' | |
difflib.get_close_matches('appel', ['ape', 'apple', 'peach', 'puppy'], n=2) | |
# returns ['apple', 'ape'] | |
# difflib.get_close_matches finds the best "good enough" matches. | |
# Here, first argument is being matched against the second one. |
These notes are pretty much the same steps as the two extensions list, it's just that I had to collate them together because neither seems to list it fully in the proper order.
-
Install Synthwave ’84/Synthwave + Fluoromachine theme on VS Code (I used the Fluoromachine one)
-
Install Custom CSS and JS Loader
-
Command + Shift + P to open command palette > "Preferences: Open settings (JSON)"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ____ _ _ ____ ___ _ _ | |
# | _ \| | / \ / ___|/ _ \| \ | | | |
# | |_) | | / _ \| | _| | | | \| | | |
# | __/| |___ / ___ \ |_| | |_| | |\ | | |
# |_| |_____/_/ \_\____|\___/|_| \_| | |
# -------------------------------------- | |
from os import listdir as os_listdir, path as os_path | |
# pip install -U scikit-learn | |
from sklearn.feature_extraction.text import TfidfVectorizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commands | |
------------ | |
1. Build Docker Image | |
docker build -t test . | |
2. Run container /w image | |
docker run -d --publish 8888:5000 test | |
3. Login to ECR | |
aws ecr get-login-password --region REGIONHERE!!!! | docker login --username AWS --password-stdin ACCOUNTIDHERE!!!!.dkr.ecr.REGIONHERE!!!.amazonaws.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const handleDragStart = (event: React.DragEvent) => { | |
event.dataTransfer.effectAllowed = 'move'; | |
event.dataTransfer.setData( | |
'text/plain', | |
event.currentTarget.getAttribute('data-index'), | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package storage | |
import ( | |
"context" | |
_ "github.com/aws/aws-sdk-go-v2/feature/s3/manager" | |
"github.com/aws/aws-sdk-go-v2/service/s3" | |
"github.com/aws/aws-sdk-go-v2/service/s3/types" | |
_ "github.com/aws/aws-sdk-go-v2/service/s3/types" | |
) |