This file contains hidden or 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
auto userDefault = cocos2d::UserDefault::getInstance(); | |
userDefault->setIntegerForKey("radius", 100); | |
CCLOG("radius : %d", userDefault->getIntegerForKey("radius")); |
This file contains hidden or 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
ssh-keygen -t rsa | |
ssh root@*.*.*.* mkdir -p .ssh | |
cat ~/.ssh/id_rsa.pub | ssh root@*.*.*.* 'cat >> ~/.ssh/authorized_keys' | |
ssh root@*.*.*.* "chmod 700 .ssh; chmod 640 ~/.ssh/authorized_keys" |
This file contains hidden or 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
ssh-keygen -t rsa | |
ssh root@*.*.*.* mkdir -p .ssh | |
cat .ssh/id_rsa.pub | ssh sheena@*.*.*.* 'cat >> .ssh/authorized_keys' | |
ssh [email protected] "chmod 700 .ssh; chmod 640 .ssh/authorized_keys" |
This file contains hidden or 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
// string to char* | |
string message = "message"; | |
char* chr = strdup(message.c_str()); |
This file contains hidden or 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
plug :authenticate when action in [:info] |
This file contains hidden or 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
# json | |
conn | |
|> put_status(401) | |
|> json(%{err: "authorization error"}) | |
|> halt | |
# text | |
conn | |
|> send_resp(404, "Post not found") | |
|> halt |
This file contains hidden or 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 random_string(length) do | |
:crypto.strong_rand_bytes(length) |> Base.url_encode64 |> binary_part(0, length) | |
end |
This file contains hidden or 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
list = 1..10 |> Enum.to_list | |
IO.puts Enum.at(list,4) | |
# 5 |
This file contains hidden or 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 jsonGET = (json) => { | |
let _ = "" | |
for(let i in json){ | |
_ += `${i}=${json[i]}&` | |
} | |
if(_.split('').reverse()[0] == '&'){ | |
_ = _.split('') | |
_.pop() | |
_ = _.join('') |