Skip to content

Instantly share code, notes, and snippets.

Being Geek!

Shekhar Prasad Rajak Shekharrajak

Being Geek!
View GitHub Profile
View One Liner to Download the Latest Release from Github
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
Shekharrajak /
Created Mar 26, 2019
sympy.integrals.rubi test

In [2]: rubi_integrate(x**2 + x + 1, x)                                                                                                                                                                       
x        ⌠     
── + x + ⎮ x dx
3        ⌡     

In [3]: rubi_integrate(x/(x**2+2*x+1), x)                                                                                                                                                                     
View daru_benchmark.rb
require_relative 'benchmarker'
$:.unshift File.expand_path("../../../lib", __FILE__)
DF_SIZE_POW_10 = [2, 3, 4, 5, 6, 7]
DF_SIZE_POW_10.each do |df_size|
puts "DataFrame of size : #{10**df_size} "
View daru_benchmarker.rb
require 'benchmark'
$:.unshift File.expand_path("../../../lib", __FILE__)
require 'daru'
class Benchmarker
@df =
@df_size = 0
View gist:0ab56c74c16ca6e49cfeedc20fee0624

If you're writing web applications with Ruby there comes a time when you might need something a lot simpler, or even faster, than Ruby on Rails or the Sinatra micro-framework. Enter Rack.

Rack describes itself as follows:

Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.

Before Rack came along Ruby web frameworks all implemented their own interfaces, which made it incredibly difficult to write web servers for them, or to share code between two different frameworks. Now almost all Ruby web frameworks implement Rack, including Rails and Sinatra, meaning that these applications can now behave in a similar fashion to one another.

At it's core Rack provides a great set of tools to allow you to build the most simple web application or interface you can. Rack applications can be written in a single line of code. But we're getting ahead of ourselves a bit.

View createFileNodeServer.js
app.get('/createFile', (req, res) => {
var fs = require("fs");
var writeStream = fs.createWriteStream("./data/dynamic_file.txt");
writeStream.write("Hi, Users. I am generated after the /createFile get request. ");
writeStream.write("Thank You.");
res.send('File is generated. Click <a href="/resources/dynamic_file.txt"> here </a> to see the file. Save/download the file using ctrl+s');
View serverStaticFile.js
app.use('/resources', express.static(path.join(__dirname, './data')));
View nodeServer.js
var express = require('express');
var app = express();
var port = process.env.PORT || 1729;
app.listen(port, function () {
console.log('Server has started at port ' + port + ' !!');

Shortcut Keys Function


Escape key Gets out of the current mode into the “command mode”. All keys are bound of commands.

  • i “Insert mode” for inserting text. Keys behave as expected.
  • : “Last-line mode” where Vim expects you to enter a command such as to save the document.

Navigation keys


Data Analysis and Visualisation in Ruby with daru

In this talk we will be learning about Ruby gem daru (Data Analysis in RUby); a library for storage, analysis, manipulation and visualisation of data. We will learn about simple and fast techniques to import & analyse data sets, exporting data and plotting charts for gaining quick insights into your data, using daru dataframe. Also we will see how daru gem is useful in Ruby framework web applications (e.g. Rails/Sinatra/Nanoc) to directly analyse/manipulate data and display interactive charts to visualise the informations, which helps users to understand it better.


  • Introducing myself
  • What is daru ?
  • Why to use daru and what makes it powerful gem for data analysis and visualisation ?