Skip to content

Instantly share code, notes, and snippets.

View codeangler's full-sized avatar

Casey Burnett codeangler

View GitHub Profile
@codeangler
codeangler / setup.sh
Created October 16, 2023 16:17 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@codeangler
codeangler / download-file.js
Created March 12, 2018 18:40 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
const posts = [
{
"code":"BAcyDyQwcXX",
"caption":"Lunch #hamont",
"likes":56,
"id":"1161022966406956503",
"display_src":"https://scontent.cdninstagram.com/hphotos-xap1/t51.2885-15/e35/12552326_495932673919321_1443393332_n.jpg"
},
{
"code":"BAcJeJrQca9",
@codeangler
codeangler / index.html
Created May 2, 2017 14:30
Redux: Avoiding Object Mutation // source https://jsbin.com/huqawa
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Redux: Avoiding Object Mutation</title>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
</head>
<body>
@codeangler
codeangler / ng1-react.md
Last active February 24, 2017 18:54
compile of articles
@codeangler
codeangler / prefix_postfix_incrementors_filter.js
Last active September 30, 2016 15:59
prefix incrementor vs postfix incrementor is critical for this to work ++prev != prev++
// 7. Write a JavaScript function that accepts a string as a parameter and counts the number of vowels within the string. Go to the editor
// Note : As the letter 'y' can be regarded as both a vowel and a consonant, we do not count 'y' as vowel here.
// Example string : 'The quick brown fox'
// Expected Output : 5
((str) => console.log(
str.split('')
.reduce(
(prev, current) => {
if("aeiouAEIOU".split('').indexOf(current) != -1){
return ++prev;
@codeangler
codeangler / settings.json
Created September 12, 2016 21:22 — forked from wesbos/settings.json
Wes Bos' Sublime Text Settings
{
"added_words":
[
"Mockup",
"plugins",
"coffeescript",
"sourcemaps",
"html",
"plugin",
"init",
var food = "pizza";
function getFood(){
console.log(food); //what does this line alert?
// Assigning var food is hoisted w/n function w/o assignment and first console.log returns undefined. Then var food is assigned saugages and returns "sausages"
var food = "sausages";
console.log(food); // what does this line alert?
}
var car = "Honda Civic";
showCar();
// By making it a function declaration scope & hoisting are not an issue
function showCar(){
console.log(car);
}