This file contains 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
# .github/workflows/example-1.yml | |
name: My First Manual Workflow | |
on: [workflow_dispatch] | |
jobs: | |
example: | |
name: Example Job | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone Repository |
This file contains 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
[{ | |
"userId": "", | |
"email": "", | |
"pin": "", | |
"recordList": [ | |
{ | |
"type": "discogs", | |
"id": "<discogs_id>" | |
}, | |
This file contains 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
<!-- /src/pages/homepage/homepage.marko --> | |
<layout-use template="../../layouts/layout.marko" navbar-current="home"> | |
<layout-put into="body"> | |
... | |
</layout-put> | |
</layout-use> |
This file contains 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
$.ajax({ | |
// blah-blah-blah, | |
success: outputSomething | |
}); | |
function outputSomething(data) { | |
$.each(data.errors, function(field, message) { | |
alert(field); // alert("body"), alert ("name") | |
}) | |
} |
This file contains 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 commentForm = $("form#newComment"); | |
commentForm.submit(function() { | |
event.preventDefault(); | |
$("#commentName").attr("disabled", true); | |
$("#commentGravatar").attr("disabled", true); | |
$("#commentWebsite").attr("disabled", true); | |
$("#commentBody").attr("disabled", true); | |
$("#createComment").attr("disabled", true); |
This file contains 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
class Comment < ActiveModel::Base | |
validate :valid_url?, :allow_blank => true | |
def valid_url? | |
if (self.website).start_with?("http://", "https://") and (self.website).end_with?(".*") | |
return true | |
elsif (self.website).end_with?(".*") | |
return true | |
self.website = "http://#{self.website}" | |
else | |
return self.errors[:website] << "The website you entered (#{self.website}) is invalid. Please try again." |
This file contains 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
class AvatarValidator < ActiveModel::Validator | |
def validate(record) | |
unless gravatar_exists? | |
return record.errors[:avatar] << "No display picture could be found on Gravatar using #{record.avatar}." | |
end | |
end | |
end | |
class Comment < ActiveRecord::Base | |
has_one :post |
This file contains 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
# URL Visiting: example.com/posts?search=My+search+text&m=aug&y=13 | |
search_sql = "MATCH (title,tags) AGAINST ('query_string('search')' IN BOOLEAN MODE)" | |
#=> MATCH (title,tags) AGAINST ('My search text' IN BOOLEAN MODE) | |
month_sql = "created_at LIKE ('%-#{return_month_number(query_string('m'))}-%')" | |
#=> created_at LIKE ('%-08-%') | |
year_sql = "MATCH (created_at) AGAINST ('#{(Time.now.strftime('%Y')[0..1]).to_s + query_string('y').to_s}' IN BOOLEAN MODE)" | |
#=> MATCH (created_at) AGAINST ('2013') | |
Post.where( |
This file contains 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
What I'm trying to achieve? | |
I want to have a left tooltip (tooltip-left) for the 2 results which display on the left hand side, and a right tooltip (tooltip-right) for the other 2 results which display on the right. |
This file contains 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 andrewpank = array( | |
"watermelon", | |
"pinapple", | |
"strawberrires" | |
); |
NewerOlder