PSR
NUM TITLE 번역 1 Basic Coding Standard 블로그 3 Logger Interface 번역 중
protocol Coffee { | |
func drink() | |
} | |
struct Americano: Coffee { | |
func drink() { | |
print("아메리카노를 마십니다.") | |
} | |
} |
struct Programmer { | |
private let coffee: Coffee | |
init(coffee: Coffee) { | |
self.coffee = coffee | |
} | |
func startProgramming() { | |
self.coffee.drink() | |
//... |
struct Programmer { | |
private let coffee = Coffee() | |
func startProgramming() { | |
self.coffee.drink() | |
//... | |
} | |
} |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell(withIdentifier: "SearchTableViewCell", for: indexPath) as! SearchTableViewCell | |
if indexPath.row == 0 { | |
cell.backgroundColor = .orange | |
} | |
return cell | |
} |
//DECODE JSON WEB TOKEN (JWT) IN IOS (OBJECTIVE-C) | |
//http://popdevelop.com/2013/12/decode-json-web-token-jwt-in-ios-objective-c/ | |
NSString *jwt = @"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIifQ.bVhBeMrW5g33Vi4FLSLn7aqcmAiupmmw-AY17YxCYLI"; | |
NSArray *segments = [jwt componentsSeparatedByString:@"."]; | |
NSString *base64String = [segments objectAtIndex: 1]; | |
NSLog(@"%@", base64String); | |
// => "eyJmb28iOiJiYXIifQ" |
import React from "react"; | |
import "./styles.css"; | |
export default function App() { | |
return <Contact /> | |
} | |
class ContactInfo extends React.Component { | |
render() { | |
return ( |
import React from "react"; | |
import "./styles.css"; | |
export default function App() { | |
return <Counter />; | |
} | |
class Counter extends React.Component { | |
constructor(props) { | |
super(props); |
class Codelab extends React.Component { | |
render() { | |
let text = "Hi I am codelab"; | |
let stylegg = { | |
backgroundColor: 'aqua' | |
}; | |
return ( | |
<div style={stylegg}>{text}</div> | |
); |
<?php | |
/** | |
* Interpolates context values into the message placeholders. | |
*/ | |
function interpolate($message, array $context = array()) | |
{ | |
// build a replacement array with braces around the context keys | |
$replace = array(); | |
foreach ($context as $key => $val) { |
PSR
NUM TITLE 번역 1 Basic Coding Standard 블로그 3 Logger Interface 번역 중