Version: 2.1.1
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
| # Count occurrences | |
| # FIND DESCRIPTION BELOW THE CODE | |
| def countDuplicates array | |
| puts array.select{|x| array.count(x) > 1} | |
| .each_with_object(Hash.new(0)) {|num,counts| counts[num] += 1} | |
| .each_value.to_a.uniq | |
| end | |
| # Usage | |
| # countDuplicates([1,3,1,4,5,6,3,2,4,4,6,7,6,7,8,8,9,7,7]); |
| # Fizz-Buzz Ruby | |
| # FIND DESCRIPTION BELOW THE CODE | |
| puts "Enter a number (integer): " | |
| n = gets.chomp.to_i | |
| i = 1 | |
| n.times do | |
| if i%3 == 0 || i%5 ==0 | |
| if i%3 == 0 && i%5 == 0 | |
| puts "FizzBuzz" |
| /* A function to return class for each Bootstrap navbar elements */ | |
| // FIND DESCRIPTION BELOW THE CODE | |
| $(function() { | |
| $( "#navbar" ).click(function() { | |
| $( "ul li" ).each(function( index ) { | |
| var class_name = $( this ).attr("class"); | |
| if( class_name === "active" || class_name === "inactive"){ | |
| console.log( index + ": " + $( this ).attr("class") ); | |
| } |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
Install the React Developer Tools Chrome Extension.
Go to the egghead website, i.e. Getting Started with Redux
Click View -> Developer -> Javascript Console, then the React tab, then
<NextUpLessonList ...> tag.<_ listType="course" list={... > tag or enter lessons in a search field and look for <inject-t-with-lessonScreenStore lessons=[{...}, {...}, {...}, ...] in results list (and then click on it).sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franzwget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.png then sudo cp franz-icon.png /opt/franzsudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktoppaste the following lines into the file, then save the file:
[Desktop Entry]
Name=Franz
Comment=
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |