Skip to content

Instantly share code, notes, and snippets.

@gokman
gokman / spring boot mysql character encoding setting
Created January 4, 2020 09:45
spring boot mysql character encoding setting
jdbc:mysql://{ip address}:3306/{db_name}?useSSL=false&serverTimezone=GMT-0&useUnicode=true&characterEncoding=utf-8
@gokman
gokman / multiple angular app configuration for nginx
Created December 30, 2019 11:48
multiple angular app configuration for nginx
1. build app1 project with prod flag
ng build --prod
2. copy files under dist folder to the server
scp -r dist/app1/* {username}@{ip address of server}:/var/www/app1/
3. set base href of application (app1 works on /)
<base href="/">
4. build app2 project with prod flag
@gokman
gokman / "Waiting for target device to come online" android emulator problem
Created December 25, 2019 19:27
"Waiting for target device to come online" android emulator problem
AVD Manager > Right click on device name > Wipe data
@gokman
gokman / angular 8 form example
Created November 15, 2019 08:46
angular 8 form example(html and ts file)
html file
<div style="padding: 10px;width: 500px;">
<form [formGroup]="contactForm" (ngSubmit)="onSubmit()">
<div class="form-group">
<label for="address">Adres</label>
<textarea style="height: 120px;resize: none;" class="form-control" formControlName="address"
id="address" aria-describedby="address" placeholder="Adres girin"></textarea>
</div>
<div class="form-group">
@gokman
gokman / angular debug with intellij
Created November 8, 2019 10:02
angular debug with intellij
1. Open Intellij go 'Edit Configurations...'
2. On Run/Debug Configuration page click plus(+) button
3. After click plus button select 'Javascript Debug' option and fill name and url (url must be the address of angular application)
--Execute project and debug ---
1. First execute angular app with:
@gokman
gokman / gist:ec932cb929a1b9c8bd9b946c42b62c25
Created October 24, 2019 20:02
create mysql container with data via docker
--create container
docker run --name {container name} -p 3306:3306 -e MYSQL_ROOT_HOST=% -e MYSQL_ROOT_PASSWORD={root password} -d {mysql image with tag}
--copy files to the container
docker cp create_db.sql {container name}:/create_db.sql
docker cp insert_db.sql {container name}:/insert_db.sql
-go into the container
docker exec -it {container name} /bin/bash
@gokman
gokman / create_entity_from_database.txt
Created February 2, 2019 14:10
create entity class on intellij
open intellij
go to menu file->project structure
click facet
add jpa
after that you will see persistence window
right click project on persistence window
click assign data source and choose datasource
right click again and click generate persistence mapping -> by database schema
view tables and entities
click ok.
@gokman
gokman / gist:b2cc03995b828c6ca179634a5b0214f4
Created August 30, 2018 09:27
import certificate to java
sudo keytool -importcert -alias dev -file xxx.crt
-keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/jre/lib/security/cacerts
@gokman
gokman / ionic2 menuToggle with hardware back button
Created October 11, 2017 19:06
ionic2 menuToggle with hardware back button
# add platform and menucontroller
# platform for hardware events
# menucontroller for menu events
import {Platform, MenuController} from "ionic-angular";
constructor( ...
public platform: Platform,
public menuCtrl: MenuController
...
@gokman
gokman / ionic debug javascript code
Created July 18, 2017 07:26
ionic debug javascript code
1. put "debugger" line anywhere you want to debug
2. open chrome and go tools-> inspect devices
3. you will see phone that connected to pc
4. click inspect under your phone on the screen
6. then go :D