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 Adapter from "ember-data/adapters/json-api"; | |
export default Adapter.extend(); |
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
local gui=require 'gui' | |
local widgets=require 'gui.widgets' | |
tutorial_screen=defclass(tutorial_screen,gui.FramedScreen) | |
function tutorial_screen:init(args) | |
self:addviews{ | |
widgets.Label{text="Info:",frame={t=1,l=1}}, | |
widgets.Label{text="Other text: Text Text text",frame={t=2,l=2}}, |
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 User < ActiveRecord::Base | |
def fetch_facebook_image | |
return false if authentications.blank? | |
auth = authentications.find_by_provider('facebook') | |
self.remote_image_url = "https://graph.facebook.com/"+auth.uid+"/picture?type=large" | |
self.save | |
end | |
end |
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
Question: Convert following into the latter data structure in less than 30 lines: | |
List: | |
A, B, C | |
A, C, E | |
E, F, D | |
D, A, J | |
E, D, J | |
List |
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
user.profile.detail = {:education=> {:degree=>[], :specialization=>[], :institution=>[]}} | |
=begin | |
Now I am trying to store it in arrays inside hashes while migrating but when I view it it will be #difficult to show the contents in order since these 3 different values are being stored in 3 different #array inside hash. | |
Considering there could be multiple rows for a single user, I wanna store it in the ascending order of dates ie first course should be entered first although I dont want to migrate start and end date. | |
How can I have a better structure of storing the values | |
I want to migrate data into this hash structure for the give table structure. | |
ID DEGREE SPECIFICATION INSTITUTION START_DATE END_DATE |
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
<?php | |
class Sg_Session_SaveHandler_Cache implements Zend_Session_SaveHandler_Interface { | |
protected $_cache; | |
/** | |
* Session lifetime | |
* | |
* @var int | |
*/ | |
protected $_lifetime = false; | |
/** |