vim .bash_profile
# add new
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
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 os | |
import numpy as np | |
from PIL import Image | |
from bs4 import BeautifulSoup | |
import io, requests, cv2 | |
from datetime import datetime | |
class Shoppe: | |
def __init__(self, background, puzzle_piece, debugger=False): | |
''' |
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
version: "3.2" | |
services: | |
rabbitmq: | |
image: rabbitmq:3-management-alpine | |
container_name: "rabbitmq" | |
ports: | |
- 5672:5672 | |
- 15672:15672 | |
volumes: | |
- ./data/rabbitmq/data/:/var/lib/rabbitmq/ |
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 imageai.Detection import ObjectDetection | |
import os | |
execution_path = os.getcwd() | |
print(execution_path) | |
detector = ObjectDetection() | |
detector.setModelTypeAsRetinaNet() | |
detector.setModelPath( os.path.join(execution_path, "resnet50_coco_best_v2.1.0.h5")) # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/1.0 | |
detector.loadModel() | |
input_image=os.path.join(execution_path, "02.png") |
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 | |
/** | |
* https://www.youtube.com/watch?v=IoLXT1UleX4&index=7&list=PLGJDCzBP5j3xGaW0AGlaVHK2TMEr2XkP9 | |
* https://github.com/ezimuel/PHP-design-patterns | |
* http://fsd14.com/post/91-design-pattern-decorator-design | |
* | |
* | |
* Chúng ta có thể sử dụng decorator pattern khi ta muốn đưa ra một số trách nhiệm bổ sung vào class cơ sở. Nghĩa là một class có thể | |
* được add thêm một chức năng của class khác mà không thay đổi cấu trúc của class. |
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
const bigint = require('big-integer') | |
const lower = 'abcdefghijklmnopqrstuvwxyz'; | |
const upper = lower.toUpperCase(); | |
const numbers = '0123456789' | |
const ig_alphabet = upper + lower + numbers + '-_' | |
const bigint_alphabet = numbers + lower | |
function toShortcode(longid) { | |
const o = bigint(longid).toString(64) |
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
$page = 0; | |
$this->PhpExcel->createSheet($page); | |
$this->PhpExcel->setActiveSheetIndex($page); | |
$sheet = $this->PhpExcel->getActiveSheet(); | |
$sheet->getStyle("A1:A7")->applyFromArray( | |
array( | |
'fill' => array( | |
'type' => PHPExcel_Style_Fill::FILL_SOLID, | |
'color' => array('rgb' => 'FFE699') |
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
version: '2.2' | |
services: | |
ignest1: | |
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.2 | |
container_name: ignest1 | |
environment: | |
- cluster.name=es-cluster | |
- node.name=ignest1 | |
- node.master=false | |
- node.data=false |
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
// MODEL Object Realm | |
import Foundation | |
import RealmSwift | |
@objcMembers class BookItem: Object { | |
enum Property: String { | |
case id, name, isCompleted | |
} | |
dynamic var id = UUID().uuidString |
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
extension UIViewController { | |
public func hideKeyboarOnTap() { | |
let tap = UITapGestureRecognizer(target: self, action: #selector(hideKeyboardAction)) | |
tap.cancelsTouchesInView = false | |
self.view.addGestureRecognizer(tap) | |
} | |
@objc private func hideKeyboardAction() { | |
self.view.endEditing(true) |
NewerOlder