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
| nohup script > script.out 2>&1 & | |
| nohup sh -c 'mysqldump -u user db > db.sql' & |
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
| To fix for a manual gem install: | |
| brew install openssl | |
| gem install mysql2 -- --with-opt-dir="$(brew --prefix openssl)" | |
| To fix for all bundle installs: | |
| brew install openssl | |
| bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)" | |
| bundle 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
| def self.sample_text(attr, scope: self, size: 3) | |
| @organic = scope.last(size).map{|item| ActionController::Base.helpers.strip_tags(item.public_send(attr)) }.compact | |
| defaults = "#{scope}::SAMPLE_#{attr.upcase}".constantize | |
| (@organic + defaults).uniq.first(size) | |
| 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
| const SvgInjectFillContentDirective = $compile => ({ | |
| restrict: "ECA", | |
| priority: -400, | |
| require: "svgInject", | |
| link(scope, $element, $attr, ctrl) { | |
| if (toString.call($element[0]).match(/SVG/)) { | |
| // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not | |
| // support innerHTML, so detect this here and try to generate the contents | |
| // specially. | |
| $element.empty(); |
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 hoverTime = 300; | |
| const fetchers = {}; | |
| function prefetch(url) { | |
| const iframe = document.createElement('iframe'); | |
| iframe.hidden = true; | |
| iframe.src = url; | |
| iframe.addEventListener('load', () => { | |
| const snapshot = Turbolinks.Snapshot.fromHTMLElement(iframe.contentDocument.documentElement); | |
| Turbolinks.controller.cache.put(url, snapshot); |
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
| systemctl status service-name.service |
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
| add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"; | |
| add_header Content-Security-Policy "default-src 'none'; img-src 'self' data: https://helio-assets-prod.zurb.com https://prod-testrun.s3-accelerate.amazonaws.com https://www.gravatar.com *.wp.com https://www.googletagmanager.com https://*.intercomassets.com https://*.intercomcdn.com https://d3utalfm9bp35r.cloudfront.net https://www.google-analytics.com; script-src 'self' 'unsafe-inline' *.algolianet.com *.algolia.net https://js.stripe.com https://*.kissmetrics.com https://cdn.headwayapp.co https://cdnjs.cloudflare.com https://*.intercomcdn.com https://*.intercom.io https://www.googletagmanager.com https://d20luy73ujukeu.cloudfront.net https://www.google-analytics.com; style-src 'self' 'unsafe-inline'; object-src 'none'; media-src 'self' https://*.intercomcdn.com https://d20luy73ujukeu.cloudfront.net; font-src 'self' https://*.intercomcdn.com; connect-src 'self' *.algolianet.com *.algolia.net https://*.kissmetrics.com h |
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 pg_exists? | |
| begin | |
| Gem::Specification::find_all_by_name('pg', '1.1.3') | |
| rescue Gem::MissingSpecVersionError | |
| false | |
| end | |
| 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
| ls -l . | egrep -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
| 'use strict' | |
| /** | |
| * A sample controller that stores data in the $rootScope | |
| */ | |
| angular.module('sample').controller('usingRootScopeController', ['$rootScope', '$scope', function ($rootScope, $scope) { | |
| // Resets the list of items. | |
| $scope.reset = function () { | |
| $rootScope.someList = []; | |
| } |
NewerOlder