Skip to content

Instantly share code, notes, and snippets.

View ironheart122's full-sized avatar
🎯
I may be slow to respond.

ironheart122 ironheart122

🎯
I may be slow to respond.
View GitHub Profile
@ironheart122
ironheart122 / SOLID.markdown
Created May 7, 2017 15:29 — forked from emaraschio/SOLID.markdown
SOLID Principles with ruby examples

#SOLID Principles with ruby examples

##SRP - Single responsibility principle A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

##OCP - Open/closed principle Software entities should be open for extension, but closed for modification.

# CBI Scraper (Offline)
# It scraps comic book issues from the website - comicsbackissues.com - and print them to a single text file
require 'oga'
require 'pry'
FILENAME = "cbi_batman.html"
class ComicBook
attr_accessor :year, :title, :issue_no, :writer, :penciller, :storyline
@ironheart122
ironheart122 / comicbook.rb
Created November 16, 2017 06:47
MildLeanDuiker created by ironbyte122 - https://repl.it/@ironbyte122/MildLeanDuiker
Empty file
@ironheart122
ironheart122 / n52_batman_chronological_list.md
Last active November 22, 2017 05:23
N52 Batman (Source: The Real Batman Chronology Project)

Justice League: Origins (5 years ago)

Batman and Robin #1

Swamp Thing #1

Batgirl #1-6 Batman and Robin #2-8 Catwoman #1-3

@ironheart122
ironheart122 / n52.csv
Last active November 24, 2017 05:26
My Personal Chronological DC New 52 Reading Order List (Credits to ComicBookReadingOrders<dot>com)
Ancient History
Red Lanterns (2011) #0 Atrocitus: The Second Prophecy
Dial H for Hero (2012) #0
Demon Knights (2011) #0
Demon Knights (2011) #1
Demon Knights (2011) #2
Demon Knights (2011) #3
Demon Knights (2011) #4
Demon Knights (2011) #5
Demon Knights (2011) #6
def gcd(n, m)
if (n > m) && (n * m > 0)
r = n % m
if r == 0
return m
else
return gcd(m, r)
end
end
@ironheart122
ironheart122 / str_incrementer.rb
Created March 27, 2018 04:57
String incrementer
def increment_string(input)
#your code here
s = input
s_digits = input.slice!(/\d+/)
s_digits_length = s_digits.length
end
@ironheart122
ironheart122 / postman_install.sh
Created August 9, 2018 18:35 — forked from oleg-sh-test/postman_install.sh
Postman install Ubuntu 18.04
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
@ironheart122
ironheart122 / deploy-create-react-app-with-nginx.md
Created August 31, 2018 06:11 — forked from huangzhuolin/deploy-create-react-app-with-nginx.md
[Deploy create-react-app(react-router) with nginx] #react #nginx

Create-react-app

Create React apps with no build configuration.

Thanks to create-react-app. It's saves a lot of my time. I remember several months ago I had to setup a lot just for a react app, webpack, babel, test environment and so on... Fortunately, everything becomes easy now. Though you have many choices of start boiler plate, you worth trying this.

React router

If you are build a SPA with react, you probably use react-router.

@ironheart122
ironheart122 / index.js
Created October 5, 2018 11:43 — forked from JonathanMH/index.js
JSON Web Token Tutorial: Express
// file: index.js
var _ = require("lodash");
var express = require("express");
var bodyParser = require("body-parser");
var jwt = require('jsonwebtoken');
var passport = require("passport");
var passportJWT = require("passport-jwt");