class Product < ActiveRecord::Base
acts_as_taggable_on :categories, :tag
....
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
import React, { useState, useEffect } from "react"; | |
import "./styles.css"; | |
const data = [ | |
{ id: 1, name: "Marco" }, | |
{ id: 2, name: "Lincoln" }, | |
{ id: 3, name: "Aya" } | |
]; | |
export default function App() { |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; | |
; Opinion Lexicon: Positive | |
; | |
; This file contains a list of POSITIVE opinion words (or sentiment words). | |
; | |
; This file and the papers can all be downloaded from | |
; http://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html | |
; | |
; If you use this list, please cite one of the following two papers: |
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
/********************************************************** | |
ADOBE SYSTEMS INCORPORATED | |
Copyright 2005-2010 Adobe Systems Incorporated | |
All Rights Reserved | |
NOTICE: Adobe permits you to use, modify, and | |
distribute this file in accordance with the terms | |
of the Adobe license agreement accompanying it. | |
If you have received this file from a source |
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 Hash | |
def deep_has_key?(key) | |
self.has_key?(key) || any? {|k, v| v.deep_has_key?(key) if v.is_a? Hash} | |
end | |
alias :deep_include? :deep_has_key? | |
alias :deep_key? :deep_has_key? | |
alias :deep_member? :deep_has_key? | |
def deep_has_value?(value) | |
self.has_value?(value) || any? {|k,v| v.deep_has_value?(value) if v.is_a? Hash} |
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
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
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
Install s3fs on Mac OS X | |
1 - Install Homebrew - http://brew.sh/ | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
2 - Use Homebrew to install s3fs + dependencies | |
brew install s3fs | |
3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097 | |
sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions |
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
wget http://stedolan.github.io/jq/download/linux64/jq | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
"Name=instance-state-name,Values=running" \ | |
| jq -r \ | |
".Reservations[] | .Instances[] | .InstanceId" \ | |
aws ec2 describe-volumes --filters \ | |
"Name=status,Values=available" \ | |
| jq -r ".Volumes[] | .VolumeId" \ |
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
wget http://stedolan.github.io/jq/download/linux64/jq | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
"Name=instance-state-name,Values=running" \ | |
| jq -r \ | |
".Reservations[] | .Instances[] | .InstanceId" \ | |
aws ec2 describe-volumes --filters \ | |
"Name=status,Values=available" \ | |
| jq -r ".Volumes[] | .VolumeId" \ |
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
# Setting up and using PostgreSQL with Rails on OS X | |
# Allows you to use PostgreSQL instead of sqlite3, and have the same database type as Heroku | |
# Install postgres using homebrew | |
brew install postgres | |
# Follow directions provided by postgres installation | |
# Instructions for this part can be retrieved again using "brew info postgres" | |
# This creates a default user according to your system name | |
# If you encounter an error similar to this, then check out these helpful links |
NewerOlder