Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
I recently had the following problem:
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost
class VideoUploader < CarrierWave::Uploader::Base | |
include ::CarrierWave::Backgrounder::Delay | |
include CarrierWave::FFmpeg | |
RESOLUTIONS = [ | |
{ version: :p1080, resolution: '1920x1080'}, | |
{ version: :p720, resolution: '1280x720'} | |
] | |
# Choose what kind of storage to use for this uploader: |
SET @db_name = '***'; | |
SELECT | |
TBname, | |
CONCAT(LPAD(REPLACE(FORMAT(B.DSize/POWER(102,pw),3),',',''),17,' '),' ', SUBSTR(' KMGTP',pw,1),'B') "Data Size", | |
CONCAT(LPAD(REPLACE(FORMAT(B.ISize/POWER(102,pw),3),',',''),17,' '),' ', SUBSTR(' KMGTP',pw,1),'B') "Index Size", | |
CONCAT(ROUND(B.ISize * 100 / B.DSize), ' %') "Percentage", | |
CONCAT(LPAD(REPLACE(FORMAT(B.TSize/POWER(102,pw),3),',',''),17,' '),' ', SUBSTR(' KMGTP',pw,1),'B') "Table Size" | |
FROM | |
(SELECT table_name TBname, data_length DSize, index_length ISize, data_length+index_length TSize |
require 'transproc/all' | |
require 'addressable/uri' | |
## | |
# Convert string keys to symbols | |
# | |
transform = Transproc(:symbolize_keys) | |
data = { | |
'name' => 'Mark Rickerby', |
Первое, без чего я уже не могу работать — alfred. Кроме запуска программ я в нем ищу файлы/папки, т.к. finder тупой:
Постоянно использую clipboard history:
В сниппетах у меня сохранены какие-то линуксовые команды, которые я никак не могу запомнить, смайлы (╯°□°)╯︵ ┻━┻ и ¯_(ツ)_/¯ (не запоминать же их)
Из плагинов постоянно использую:
# Sample Nginx config with sane caching settings for modern web development | |
# | |
# Motivation: | |
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
# and juicy version of your assets available. | |
# At some point, however, you want to show your work to testers, your boss or your client. | |
# After you implemented and deployed their feedback, they reload the testing page – and report | |
# the exact same issues as before! What happened? Of course, they did not have developer tools | |
# open, and of course, they did not empty their caches before navigating to your site. |
If you have your code defined in classes in lib/ folder you may have problems to load that code in production.
Autoloading is disabled in the production environment by default because of thread safety.
Change config/application.rb:
config.autoload_paths << Rails.root.join("lib")
config.eager_load_paths << Rails.root.join("lib")