Skip to content

Instantly share code, notes, and snippets.

View simondebbarma's full-sized avatar
:octocat:
1337

Simon Debbarma simondebbarma

:octocat:
1337
View GitHub Profile
@simondebbarma
simondebbarma / favicons.js
Last active April 20, 2022 17:15 — forked from frabert/COPYING
Favicons for HN
// ==UserScript==
// @name Favicons for HN
// @version 1
// @match https://news.ycombinator.com/*
// ==/UserScript==
for (let link of document.querySelectorAll('.titlelink')) {
if (link.attributes["hasIcon"] != 'true') {
const domain = new URL(link.href).hostname
const imageUrl = `https://icons.duckduckgo.com/ip3/${domain}.ico`
function insertionSort(arr) {
if(arr.length <= 1){
return arr
}
let array = arr
let cache = []
while(array.length > 0){
let smallest = smallestNum(array)
@simondebbarma
simondebbarma / bubble-sort.js
Created February 4, 2022 13:59
A first-pass of Bubble Sort. Will optimize it later.
function bubbleSort(input){
let result = []
input.forEach((e,i,a)=>{
let cache = {};
cache["itemA"] = e
cache["itemB"] = a[i + 1]
if(cache.itemA > cache.itemB && i < a.length){
a[i] = cache["itemB"]
a[i+1] = cache["itemA"]
}
@simondebbarma
simondebbarma / config.js
Created October 16, 2021 12:07 — forked from codediodeio/config.js
Snippets from the Firestore Data Modeling Course
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
@simondebbarma
simondebbarma / CSGO chat troll commands by Anomaly
Created July 21, 2021 03:04
CSGO chat troll commands by Anomaly
Color:
Used by item unboxe
Light Blue:
Blue:
Purple:
Pink: 
Red / knife: 
Others:
/* Reset provided by https://github.com/gatsbyjs/gatsby-starter-blog via MIT license */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
-webkit-font-smoothing: antialiased;
@simondebbarma
simondebbarma / multiple_instances_of_state.rb
Created March 21, 2020 14:23 — forked from havenwood/multiple_instances_of_state.rb
Examples of a module, class and singleton class in Ruby
class MultipleInstancesOfState
attr_accessor :state
def initialize(state:)
@state = state
end
def foo
@state.reverse!
end

Design patterns are solutions to recurring problems; guidelines on how to tackle certain problems. They are not classes, packages or libraries that you can plug into your application and wait for the magic to happen. These are, rather, guidelines on how to tackle certain problems in certain situations.

Design patterns are solutions to recurring problems; guidelines on how to tackle certain problems

Wikipedia describes them as

In software engineering, a software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations.

Be Careful

<body>
<div class="canvas">
<div class="whitey-beak"></div>
<div class="yellow-beak"></div>
<div class="whitey-tail one"></div>
<div class="whitey-tail two"></div>
<div class="yellow-tail"></div>
@simondebbarma
simondebbarma / ruby_books.md
Created February 24, 2020 05:04 — forked from baweaver/ruby_books.md
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.