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
// searches MongoDb for all users with a rank limit 10000 | |
User.aggregate([ | |
{ | |
$project: { | |
_id: "$_id", | |
rank: "$rank" | |
} | |
}, | |
{ | |
$match: { |
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
// unset all users' rank from db | |
await User.bulkWrite([{updateMany : { | |
filter: { rank: {$exists: true}}, | |
update: { $unset: { rank: 1 } } | |
} | |
}]) |
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
48 Laws of Power - Robert Greene | |
Be Here Now - Ram Dass | |
Extreme Ownership - Jocko Willink and Leif Babin | |
How to Eat - Thich Nhat Hanh | |
How to Win Friends & Influence People - Dale Carnegie | |
Radical Focus - Christina Wodtke | |
ReWork - Jason Fried & David Hansson | |
Sapiens - Yuval Noah Harari | |
Shantaram - Gregory David Roberts | |
Soft Skills - John Sonmez |
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 { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { | |
author = getAuthor(); | |
title = `my-app by ${this.author}`; |
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 requests | |
from bs4 import BeautifulSoup | |
result = requests.get("https://www.webscraper.io/test-sites/e-commerce/allinone") | |
soup = BeautifulSoup(result.content) | |
links = soup.find_all("a", "title") | |
data = {} | |
for link in links: | |
title = link.string | |
data[title] = link.attrs['href'] |
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
😀 | :smile | |
---|---|---|
😬 | :simply |
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
#!/usr/bin/env python3 | |
# Detects text in a document stored in an S3 bucket. | |
import boto3 | |
import sys | |
from time import sleep | |
import math | |
import pandas as pd | |
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
class Ceo: | |
__instance = None | |
def getInstance(): | |
if Ceo.__instance == None: | |
Ceo() | |
return Ceo.__instance | |
def __init__(self): | |
if Ceo.__instance != None: |
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
{ | |
"type": "mysql", | |
"host": "localhost", | |
"port": 3306, | |
"username": "test", | |
"password": "test", | |
"database": "test", | |
"synchronize": true, | |
"logging": false, | |
"entities": [ |
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 {Entity, PrimaryGeneratedColumn, Column} from "typeorm"; | |
@Entity() | |
export class User { | |
@PrimaryGeneratedColumn() | |
id: number; | |
@Column() | |
firstName: string; |
OlderNewer