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
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
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
**Error:** | |
3.1) Failure/Error: @service = @fastly.create_service(:name => name) | |
Fastly::Error: | |
{"msg":"Bad request","detail":"Exceeding max_total_services: 10"} | |
**Solution** | |
``` | |
$ rails c |
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
``` | |
require 'csv' | |
file = "#{Rails.root}/public/user_data.csv" | |
products = Product.order(:first_name) | |
headers = ["Product ID", "Name", "Price", "Description"] | |
CSV.open(file, 'w', write_headers: true, headers: headers) do |writer| |
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
``` | |
var jqry = document.createElement('script'); | |
jqry.src = "https://code.jquery.com/jquery-3.3.1.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jqry); | |
``` | |
Now `$` and all the other good stuff will be available |
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
## Rendering with status and location headers: | |
All renders take the :status and :location options and turn them into headers. They can even be used together: | |
```Ruby | |
render :xml => post.to_xml, :status => :created, :location => post_url(post) | |
``` | |
Note that the :status option accepts not only an HTTP status code (such as 500), | |
but also a symbol representing that code (such as :created), if that makes more sense to you. |
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
refile problem - need to use downgraded bundler version to install gems | |
```Bash | |
$ gem install bundler -v 2.0.1 | |
$ bundle _2.0.1_ install | |
``` |
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
$ ls -lah | |
$ sudo chown -R <username> <directory_name> |
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
git fetch upstream | |
git reset --hard upstream/master |
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
git fetch upstream | |
git reset --hard upstream/master |
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
import * as DomEvent from './DomEvent'; | |
import * as Util from '../core/Util'; | |
import * as Browser from '../core/Browser'; | |
/* | |
* Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices. | |
*/ | |
var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown'; |