I like Pages.app, but don't want to deal with constantly copying and pasting code around.
Here is how I do syntax highlighting in Pages.app by pressing a key command. It's based off of this post on stack exchange.
sudo easy_install Pygments
# In our gemfile: | |
# gem 'rubyzip' | |
require 'zip' | |
# private ? | |
def process_and_create_zip_file | |
# Simulation of an object with has_many_attached :documents | |
job = Job.first.documents | |
# Tmp folder to store the download files from S3 |
# The trick is to link the DeviceSupport folder from the beta to the stable version. | |
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
# (A similar approach works for older versions too, just change the version number after DeviceSupport) |
# Elm Sprockets Integration for Rails 3 | |
# | |
# I'm working on turning this into a Gem - see https://github.com/NoRedInk/sprockets-elm - but | |
# I know a lot more about Elm than I do Rails, and haven't gotten that version working yet. | |
# If you know how to help Gemify this, by all means please hit me up! https://twitter.com/rtfeldman | |
# I could definitely use the help. | |
# | |
# Anyway, in the meantime, this is what we're using at NoRedInk to integrate Elm into our asset | |
# pipeline, and it works like a charm. Just copy this into config/initializers/elm_sprockets.rb | |
# |
To circle.yml: | |
dependencies: | |
post: | |
- bin/cisetup | |
checkout: | |
post: | |
- git fetch origin --depth=1000000 |
================================================= | |
After software installation | |
================================================= | |
RUN apt-get clean | |
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
================================================= | |
Docker on build process, include all files on directory build (include .git with old build) | |
Solution for reduce size of docker image (but for reuse is not good solution) | |
================================================= |
I like Pages.app, but don't want to deal with constantly copying and pasting code around.
Here is how I do syntax highlighting in Pages.app by pressing a key command. It's based off of this post on stack exchange.
sudo easy_install Pygments
CREATE EXTENSION tablefunc; | |
CREATE TABLE sales(year int, month int, qty int); | |
INSERT INTO sales VALUES(2007, 1, 1000); | |
INSERT INTO sales VALUES(2007, 2, 1500); | |
INSERT INTO sales VALUES(2007, 7, 500); | |
INSERT INTO sales VALUES(2007, 11, 1500); | |
INSERT INTO sales VALUES(2007, 12, 2000); | |
INSERT INTO sales VALUES(2008, 1, 1000); | |
INSERT INTO sales VALUES(2009, 5, 2500); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<link type="text/css" rel="stylesheet" href="style.css"/> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<style> | |
.node circle { | |
cursor: pointer; | |
fill: #fff; |
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add: