Skip to content

Instantly share code, notes, and snippets.

View abhayathapa's full-sized avatar

Abhaya Thapa abhayathapa

  • Kathmandu, Nepal
View GitHub Profile
@abhayathapa
abhayathapa / 99minds-directory-size.rb
Created January 30, 2023 05:42
Solution for 99minds to find Sum of sizes of directories less than 100000
require 'open-uri'
input = URI.open("https://gist.githubusercontent.com/ronakjain90/3dcfef6a752f77b3e8202ad9844195ae/raw/599eaaeec9f47b70a44da3454a731fee639efff3/input.txt").readlines
current_directory = []
directories = Hash.new { |h, k| h[k] = 0 }
input
.map(&:chomp)
.map(&:split)
.each do |line|
@abhayathapa
abhayathapa / ember_examples.md
Last active September 1, 2015 06:04 — forked from rwjblue/ember_examples.md
Ember Examples
@abhayathapa
abhayathapa / js_hacks
Created November 30, 2013 07:13
JS and jquery best practise and hacks
/*
[Best Practices for Beginners](http://net.tutsplus.com/tutorials/JavaScript-ajax/24-JavaScript-best-practices-for-beginners/)
[Airbnb styleguides](https://github.com/airbnb/JavaScript)
[Write better query](http://flippinawesome.org/2013/11/25/writing-better-jquery-code/)
[Best practices guide for JavaScript](https://github.com/stevekwan/best-practices/blob/master/javascript/best-practices.md)
[The Essentials of Writing High Quality JavaScript](http://net.tutsplus.com/tutorials/JavaScript-ajax/the-essentials-of-writing-high-quality-JavaScript/)
[Increase your jquery performance](http://net.tutsplus.com/tutorials/JavaScript-ajax/10-ways-to-instantly-increase-your-jQuery-performance/)
*/
// Old - ifElse
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@abhayathapa
abhayathapa / .tmux.conf
Created August 26, 2013 08:25
Tmux config
# Last modified: 2012 Jul 19
# Author: Florian CROUZAT <contact@floriancrouzat.net>
# Feel free to do whatever you want with this file.
# Just make sure to credit what deserve credits.
#killall tmux; tmux # kill tmux sessions
# make selection from mouse -OPT select
#PREFIX : -> bring command prompt
#PREFIX ? -> bring key-bindings
#PREFIX , -> rename current window