A complete gdb to lldb command map.
- Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
- p - Print primitive type
A complete gdb to lldb command map.
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
i " вставить текст до курсора
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
I heard from GitHub Two-Factor Authentication](https://github.com/blog/1614-two-factor-authentication) nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn' push to any of my repositories anymore. Learn in this blog post how to fix it.
"Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network". Github solves this authentication with sending an SMS to a device which wants to push to their platform.
(ns slack | |
(:require [clj-http.client :as client] | |
[clojure.data.json :as json])) | |
(defn send-to-slack | |
"Sends a simple message to slack using an 'incoming webhook'. | |
url will be of form: https://myapp.slack.com/services/hooks/incoming-webhook?token=mytoken . | |
(Exact url you should use will appear on the slack integration page) | |
text will be any valid message. | |
This implementation could be expanded if you wanted to specify channel, username, etc. |
# Let's say you were stupid and used the postgres account for something you | |
# shouldn't have, so you have a database owned by postgres, with all objects | |
# inside owned by postgres. You regain sanity and want to transfer the | |
# ownership to an account that isn't a database superuser. | |
# | |
# In most cases, reassigning ownership is as simple as using | |
# REASSIGNED OWNED. However, that does not work if you are using the | |
# postgres account, so you have to alter the ownership manually. | |
# | |
# First, make sure you connect to the database using the postgres account. |
/** | |
* @brief executeQueriesFromFile Read each line from a .sql QFile | |
* (assumed to not have been opened before this function), and when ; is reached, execute | |
* the SQL gathered until then on the query object. Then do this until a COMMIT SQL | |
* statement is found. In other words, this function assumes each file is a single | |
* SQL transaction, ending with a COMMIT line. | |
*/ | |
void executeQueriesFromFile(QFile *file, QSqlQuery *query) | |
{ |
require 'openssl' | |
key = OpenSSL::PKey::RSA.new(2048) | |
p encrypted_string = key.public_encrypt('my plaintext string', OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) | |
p decrypted_string = key.private_decrypt(encrypted_string, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) |
require 'mongoid' | |
require 'pp' | |
Mongoid.configure do |config| | |
config.allow_dynamic_fields = false | |
config.connect_to 'mongo_test', { consistency: :strong } | |
end | |
Mongoid.default_session.drop |