Skip to content

Instantly share code, notes, and snippets.

View PallaviTS's full-sized avatar

Pallavi TS PallaviTS

View GitHub Profile
@PallaviTS
PallaviTS / README.md
Created September 22, 2017 06:56 — forked from ericcoopey/README.md
D3 Word Cloud implementation

Word cloud implementation.

Example of how to

  1. Change style from default. Uses linear scale

  2. Alter word size

  3. "Fit" it into the screen. At first the words were appearing out of view to the left.

@PallaviTS
PallaviTS / cloud.js
Last active September 22, 2017 07:17 — forked from blockspring/cloud.js
D3 Wordcloud
// Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf
(function() {
function cloud() {
var size = [256, 256],
text = cloudText,
font = cloudFont,
fontSize = cloudFontSize,
fontStyle = cloudFontNormal,
fontWeight = cloudFontNormal,
@PallaviTS
PallaviTS / .block
Created September 22, 2017 06:49 — forked from mbostock/.block
Force-Directed Graph
license: gpl-3.0
height: 600
@PallaviTS
PallaviTS / force.csv
Last active May 25, 2017 16:18 — forked from d3noob/.block
Directional Force Layout Diagram with node colouring
source target value
Drugs Drug Classes 1.2
Drug Classes Drugs 1.3
Therapeutic Areas Drugs 0.2
Drugs Manufacturers 0.5
Manufacturers Drugs 1.6
Drugs Drug Strengths 0.4
Drugs Drugs 0.6
Drugs Health Plan Drug Comments 0.7
Health Plans Health Plan Drug Comments 0.8
name source target value
Battle of the Golden Tooth Lannister Tully 15000
Battle at the Mummer's Ford Lannister Baratheon
Battle of Riverrun Lannister Tully 15000
Battle of the Green Fork Stark Lannister 18000
Battle of the Whispering Wood Stark Lannister 1875
Battle of the Camps Stark Lannister 6000
Sack of Darry Lannister Darry
Battle of Moat Cailin Greyjoy Stark
Battle of Deepwood Motte Greyjoy Stark 1000
@PallaviTS
PallaviTS / .block
Last active May 25, 2017 15:27 — forked from mbostock/.block
Epicyclic Gearing
license: gpl-3.0
=form_for @navigation_link, :url => admin_site_map_pages_path , method: :post ,remote: true do | f |
= f.text_field :title
%pre= @navigation_link_title.inspect
= f.submit t("buttons.save"), disable_with: t('text.please_wait')
%pre= @navigation_link.inspect
@PallaviTS
PallaviTS / gist:6452462
Created September 5, 2013 16:19
How do we set rails-timeago for different languages ?
I created a timeago.rb in config/initializers
Rails::Timeago.default_options :limit => proc { 20.days.ago }, :nojs => true
Rails::Timeago.locales = [:en, :ja, :it]
But where do I place the jquery.timeago.XX.js files ??
Rails::Timeago.locales ---> where does it look for all the locale files ??
Im getting locales not found
-unless @block.present?
= form_tag "/blocks" do
= hidden_field_tag 'block[person_id]', @person.id.to_s
= submit_tag 'Block', :class => "block_user", :onclick => "confirm('Ignore this User?')" do
.icons-ignoreuser
pallavi@pallavi-work:~/projects/dev/app/models$ rails s
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-07-06 14:59:57] INFO WEBrick 1.3.1
[2013-07-06 14:59:57] INFO ruby 1.9.3 (2012-04-20) [i686-linux]
[2013-07-06 14:59:57] INFO WEBrick::HTTPServer#start: pid=9231 port=3000