Skip to content

Instantly share code, notes, and snippets.

View dumpofmemory's full-sized avatar
🎯
Focusing

Sam dumpofmemory

🎯
Focusing
View GitHub Profile
@dumpofmemory
dumpofmemory / array_dupplicate_counter.js
Created December 19, 2016 10:31 — forked from ralphcrisostomo/array_dupplicate_counter.js
Javascript: Count duplicates in an array
/**
Problem:
You have a javascript array that likely has some duplicate values and you would like a count of those values.
Solution:
Try this schnippet out.
*/
@dumpofmemory
dumpofmemory / A.markdown
Created March 1, 2017 11:21 — forked from larrybotha/A.markdown
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

@dumpofmemory
dumpofmemory / index.html
Created January 6, 2018 20:10
weatherAPI (freeCodeCamp)
<h1 class="title">weatherAPI</h1>
<div class="container" id="demo">
</div>
<div id="weather"></div>
<label class="switch">
<input type="checkbox" checked id="triggr">
<span class="slider round"></span>
</label>
<script src="js/jquery-3.2.1.min.js"></script>
@dumpofmemory
dumpofmemory / repo-reset.md
Created March 20, 2018 14:25 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@dumpofmemory
dumpofmemory / index.html
Created March 17, 2019 18:19
ReactJS: Adding and removing classes
<div id="root">
</div>
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-react",
"tslint-config-prettier"
],
"jsRules": {},
"rules": {
"jsx-no-lambda": false,
{
"compilerOptions": {
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": [
"es6",
"dom"
],
"plugins": [
{
"extends": "./tsconfig.json"
}
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs"
}
}