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
Int integerSample = 123; | |
switch(integerSample){ | |
case 123: | |
"123" | |
break; | |
default: | |
"" | |
} | |
//I'm 🤔 if it compiles |
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
val integerSample: Int = 123 | |
val stringInteger: String = integerSample match { | |
case 123 => “123” | |
case _ => “” | |
} |
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
val configHost = ??? | |
val configId = ??? | |
val configPass = ??? | |
loadConfig( | |
host = configHost, | |
id = configId, | |
pass = configPass) |
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
final case class ConfigHost(value: String) | |
final case class ConfigId(value: String) | |
final case class ConfigPass(value: String) | |
def loadConfig(host: ConfigHost, id: ConfigId, pass: ConfigPass): Unit = ??? |
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
config = load_config(“root”, “1234”, “localhost”) |
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
def load_config(host, id, pass): | |
... |
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
function getColorSets(){ | |
const numberRange = [...Array( 14).keys()].map( x => x * 20) // [0,20..260] | |
const addZero = function( val){ return ( val.length < 2) ? "0" + val : val; } | |
const defaultColors = ["f44336","E91E63","9C27B0","673AB7","3F51B5","2196F3","03A9F4","00BCD4","009688", | |
"4CAF50","8BC34A","CDDC39","FFEB3B","FFC107","FF9800","FF5722","795548","9E9E9E","607D8B"] | |
const flattenList = function( unFlattenedList){ [].concat.apply([], unFlattenedList) } | |
const generateSet = function( colors, n) { | |
return colors.map( x => [[x.slice(0,2)],[x.slice(2,4)],[x.slice(4,6)]]) // slice RGB | |
.map(x => x.map( d => addZero( ( ( parseInt( d, 16) + n) % 255).toString( 16)))) | |
.map( x => x.join( "")) |
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
Hierarchy | |
src -firstApp(django) | |
- Dockerfile | |
- anyother necessaries | |
-secondApp(hello-world) | |
- Dockerfile | |
- anyother necessaries | |
-haprxy | |
- Dockerfile | |
- haproxy.cfg |
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
1. Make folder tree like these | |
mi_project | |
├── src | |
│ ├── midjangoapp | |
│ ├── manage.py | |
├── config | |
│ ├── requirements.pip | |
│ ├── nginx | |
│ ├── midjangoapp.conf | |
├── Dockerfile |
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 pymysql | |
class DBConn: | |
conn_obj = None | |
def __init__(self): | |
try: | |
db = pymysql.connect(host="", | |
user="", | |
passwd="", |