Skip to content

Instantly share code, notes, and snippets.

View yatinsns's full-sized avatar

Yatin Sarbalia yatinsns

View GitHub Profile
@yatinsns
yatinsns / react-play-nines.js
Last active February 11, 2019 15:01
React - Play Nines
var possibleCombinationSum = function(arr, n) {
if (arr.indexOf(n) >= 0) { return true; }
if (arr[0] > n) { return false; }
if (arr[arr.length - 1] > n) {
arr.pop();
return possibleCombinationSum(arr, n);
}
var listSize = arr.length, combinationsCount = (1 << listSize)
for (var i = 1; i < combinationsCount ; i++ ) {
var combinationSum = 0;

Todo App Creation

Visit Flock’s Developer Dashboard, and click on Start Creating a Flock App.

Basic Information

Fill in the information requested and Click on the Save button to create the app.

App Name: Todo
App URL: todo
require 'rubygems'
require 'nokogiri'
require 'open-uri'
def get_page url
Nokogiri::HTML(open(url))
end
def get_live_score_div page
page.css("div[id='live']")
May your birthday and every day be filled with the warmth of sunshine, the happiness of smiles, the sounds of laughter, the feeling of love and the sharing of good cheer.
On this special day, i wish you all the very best, all the joy you can ever have and may you be blessed abundantly today, tomorrow and the days to come! May you have a fantastic birthday and many more to come... HAPPY BIRTHDAY!!!!
Wishing you all the great things in life, hope this day will bring you an extra share of all that makes you happiest. Happy Birthday!
Happy birthday!!! Hope you have a blast!!!
We wish you all the happiness in the world! Happy Birthday!
Happy Birthday!!! I hope this is the begining of your greatest, most wonderful year ever!
Another year older, but unfortunately none wiser!Happy Birthday!!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
@yatinsns
yatinsns / Thor_example.rb
Last active May 13, 2021 16:49
Ruby : Thor used to add commands / subcommands as arguments.
require 'thor'
class MyCLI < Thor
# class options that apply across all commands for a class.
class_option :verbose, :type => :boolean
desc "hello NAME", "say hello to NAME"
def hello(name)
puts "Hello #{name}"
end
@yatinsns
yatinsns / create_jekyll_post.rb
Last active August 29, 2015 14:22
Ruby script to create new post in jekyll for <username>.github.io
#!/usr/bin/env ruby
POSTS_DIR = ENV['POSTS_DIR']
def header title
timestamp = `date "+%Y-%m-%d %H:%M:%S"`.chomp
contents = "---\n" +
"layout: post\n" +
"title: #{title}\n" +
"date: #{timestamp}\n" +
@yatinsns
yatinsns / open-fogbugz-urls.rb
Created June 10, 2015 06:03
Open Fogbugz Tasks
TASKS_IDS = [1138, 1735, 1734, 1641, 1629, 1628, 1625, 1506, 1555, 1554, 1193, 1526, 1626, 1710, 1395, 1539, 1189, 1317, 1483, 1481, 1482]
def open_links
TASKS_IDS.each do |task_id|
`open https://talkto.fogbugz.com/f/cases/#{task_id}/`
sleep 0.5
end
end
open_links if __FILE__ == $0