Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Nick0603

View GitHub Profile
View TripService.js
"use strict";
let UserSession = require('./UserSession');
let TripDAO = require('./TripDAO');
class TripService {
getTripsByUser(user) {
let tripList = [];
let loggedUser = UserSession.getLoggedUser();
let isFriend = false;
View Day1_02
const navHeight = document.querySelector('nav');
const options = {
root: null,
rootMargin: `-${navHeight}px 0px 0px 0px`,
threshold: [0]
}
View Day1_01
const observer = new IntersectionObserver(callback, options);
View L15
var DNA_LENGTH = 500; // 每個火箭的基因長度
var SIZE = 30; // 每一個世代的火箭個數
var rockets = []; // 存放所有的火箭
// 初始化所有的火箭
for (var i = 0; i < SIZE; i++) {
var rocket = new Rocket();
rocket.gens = randomGens();
rocket.fire();
rockets.push(rocket);
View flapybird_Q
{
"undefined": [
0,
0
],
"-1:-32": [
0,
0
],
"-1:-31": [
View mysql docker-compose.yml
version: '3.3'
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: ${DB_DATABASE:-werewolves}
MYSQL_USER: ${DB_USERNAME:-user}
MYSQL_PASSWORD: ${DB_PASSWORD:-password}
MYSQL_ROOT_PASSWORD: 'password'
View gitlab-ci v2
image: lorisleiva/laravel-docker:latest
stages:
- testing
- deployment
unit_test:
stage: testing
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
View gitlab-cd example for heroku
image: lorisleiva/laravel-docker:latest
production_deploy:
variables:
HEROKU_PROJECT_NAME: $HEROKU_PRODUCTION_PROJECT_NAME
HEROKU_API_KEY: $HEROKU_PRODUCTION_API_KEY
before_script:
- apk add ruby ruby-dev ruby-irb ruby-rake ruby-io-console ruby-bigdecimal ruby-json ruby-bundler yarn ruby-rdoc >> /dev/null
- apk update
- gem install dpl >> /dev/null
View fail test
<?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExampleTest extends TestCase
{
/**
View gitlab learn-cicd for unit_test
image: lorisleiva/laravel-docker:latest
unit_test:
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- ./vendor/bin/phpunit --testsuit Unit --coverage-text --colors=never