Skip to content

Instantly share code, notes, and snippets.

View chris-sev's full-sized avatar
🟨
create not consume

Chris Sev chris-sev

🟨
create not consume
View GitHub Profile
@chris-sev
chris-sev / TrackBentoEvent.php
Created June 12, 2023 15:45
laravel bentonow.com event tracking
<?php
namespace App\Actions\Bento;
use Exception;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Lorisleiva\Actions\Concerns\AsAction;
class TrackBentoEvent
@chris-sev
chris-sev / function.sh
Created May 25, 2021 15:35 — forked from jldeen/function.sh
toggle mac menu bar
function toggleMenu () {
~/.dotfiles/bin/toggleMenuBigSur.sh
}
@chris-sev
chris-sev / setup.sh
Last active February 10, 2024 03:17
Mac Setup
# how to run this thingy
# create a file on your mac called setup.sh
# run it from terminal with: sh setup.sh
# heavily inspired by https://twitter.com/damcclean
# https://github.com/damcclean/dotfiles/blob/master/install.sh
# faster dock hiding/showing (run in terminal)
# defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
@chris-sev
chris-sev / array-is-array-check.js
Created December 23, 2018 16:04
Checking a Value
const names = ['Pete', 'John', 'Mary'];
const isArray = Array.isArray(names);
console.log(isArray); // true
@chris-sev
chris-sev / array-is-array.js
Created December 23, 2018 16:02
Quick Example
console.log(Array.isArray('one')); // false
console.log(Array.isArray(['thing1', 'thing2'])); // true
@chris-sev
chris-sev / array-find-less-than-50.js
Created December 21, 2018 17:23
First Number Under 50
const numbers = [60, 32, 55, 22, 10];
const lessThan50 = numbers.find(number => number < 50 );
console.log(lessThan50);
// output: 32
@chris-sev
chris-sev / array-find-object.js
Created December 21, 2018 17:13
find() in array of objects
const people = [
{ name: 'chris', username: 'chrisoncode' },
{ name: 'nick', username: 'whatnicktweets' },
{ name: 'holly', username: 'hollylawly' },
];
people.find(person => person.name === 'holly');
// output: { name: 'holly', username: 'hollylawly' }
@chris-sev
chris-sev / array-find.js
Created December 21, 2018 16:29
Quick Example
const people = ['chris', 'nick', 'holly'];
// find chris
const singlePerson = people.find(name => name === 'chris');
console.log(singlePerson);
// output: chris
@chris-sev
chris-sev / array-concat.js
Created December 20, 2018 17:29
Combining Arrays
const months = ['March', 'April', 'May'];
const otherMonths = ['June', 'July'];
const totalMonths = months.concat(otherMonths);
console.log(totalMonths);
@chris-sev
chris-sev / array-concat-quick.js
Last active December 20, 2018 17:06
Quick Example
// we have 2 arrays of people
const people = ['chris', 'nick'];
const newPeople = ['holly', 'william'];
// add them together to create a new array
const allPeople = people.concat(newPeople);
// output: ['chris', 'nick', 'holly', 'william']
console.log(allPeople);