Skip to content

Instantly share code, notes, and snippets.

View naimrajib07's full-sized avatar

Naim Rajiv naimrajib07

View GitHub Profile
def rot13(secrete_messages)
alphabetSet = {1 => 'a', 2 => 'b', 3 => 'c', 4 => 'd', 5 => 'e', 6 => 'f', 7 => 'g',
8 => 'h', 9 => 'i', 10 => 'j', 11 => 'k', 12 => 'l', 13 => 'm', 14 => 'n',
15 => 'o', 16 => 'p', 17 => 'q', 18 => 'r', 19 => 's', 20 => 't', 21 => 'u',
22 => 'v', 23 => 'w', 24 => 'x', 25 => 'y', 26 => 'z'}
secrete_messages.map do |elm|
if (elm == '' || !alphabetSet.has_value?(elm.downcase))
if(elm.length > 1)
rot13(elm.split('')).join()
@naimrajib07
naimrajib07 / WifiWebServer.ino
Last active July 4, 2017 01:56
Arduino and Node MCU ESP-8266 12E webserver.
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#define LISTEN_PORT 80
// Set your wifi credential
const char *ssid = "Your Wifi Name";
const char *password = "Your Wifi Password";
@naimrajib07
naimrajib07 / .powenv
Created April 2, 2017 19:28 — forked from dre1080/.powenv
Using Pow!! with Foreman (Configuration)
# In your app's root.
# Make Pow!! export all the env variables contained in the .env file used by Foreman.
export $(cat .env)
@naimrajib07
naimrajib07 / links.textile
Created January 29, 2016 10:24 — forked from lucashungaro/links.textile
Links de referência utilizados em minha palestra
@naimrajib07
naimrajib07 / rspec_model_testing_template.rb
Created December 9, 2015 09:30 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@naimrajib07
naimrajib07 / gist:92e43aa19359fb68bba9
Created October 2, 2015 16:12 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@naimrajib07
naimrajib07 / how_to_concerns.md
Last active August 29, 2015 14:25 — forked from jhjguxin/how_to_concerns.md
how to concerns with rails 3
@naimrajib07
naimrajib07 / bit_counter.rb
Last active August 29, 2015 14:23
Number Of Bit Count From A Image
# @params img_file String
# @return number of 0 and 1
#
# irb =>
# => require '/home/naim/Desktop/bit_counter.rb'
# => count_bits '/home/naim/Desktop/SAM_1247.jpg'
#
def count_bits img_file
img_file = File.read img_file
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS