$ rails g model User
belongs_to
has_one
require 'restclient' | |
require 'json' | |
require 'digest' | |
class IGDownloader | |
def initialize(output_path) | |
@base_output_path = output_path | |
end |
Using Notepad++ search and replac all the illegal characters in XML file | |
//#1 All cells with whitespace and chars like '&' but start with alphabets | |
Find: <Data ss:Type="String">([a-zA-Z]+(.+))</Data> | |
Replace: <Data ss:Type="String"><![CDATA[$1]]></Data> | |
//#2 All empty cells | |
Find: <Data ss:Type="String">*</Data> | |
Replace: <Data ss:Type="String"><![CDATA[-]]></Data> |
--- | |
layout: nil | |
title : Atom Feed | |
--- | |
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE xsl:stylesheet [<!ENTITY mdash "—">]> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title type="text" xml:lang="en">{{site.name}}</title> | |
<link type="application/atom+xml" href="{{site.url}}/feed.xml" rel="self"/> | |
<link type="text/html" href="{{site.url}}" rel="alternate"/> |
# This utility class is help gather data while avoiding | |
# Github's seach restriction of 1,000 results | |
# and traverse through the results using Link headers | |
# FYI: Our results is about 2700 | |
require 'rest_client' | |
require 'json' | |
class Utility | |
@url = "https://api.github.com/search/users" |
require 'rest_client' | |
class Plh | |
def self.parse_link_header(url, params={}) | |
response = RestClient.get url, params | |
links = Hash.new | |
parts = response.headers[:link].split(',') | |
# Parse each part into a named link | |
parts.each do |part, index| |
/*****************************************************************************/ | |
/* Links | |
/*****************************************************************************/ | |
a { | |
color: black !important; | |
text-decoration: none !important; | |
cursor: pointer; | |
} | |
.post a { | |
border-bottom: 1px dotted #b3b3b1; |
# one-to-one, bidirectional | |
Customer: | |
oneToOne: | |
cart: | |
targetEntity: Cart | |
mappedBy: customer | |
Cart: | |
oneToOne: | |
customer: | |
targetEntity: Customer |
<?php | |
//... | |
class Person | |
{ | |
/* @var \Doctrine\Common\Collections\Collection */ | |
private $talents | |
/* @var string */ | |
private $gender | |