Skip to content

Instantly share code, notes, and snippets.

View yosevu's full-sized avatar

Yosevu Kilonzo yosevu

View GitHub Profile
@yosevu
yosevu / local-host-browser-testing.md
Last active January 15, 2020 21:14
Test local host on other devices

Local Host Browser Testing on Other Devices

iOS

  • Find IP address

    • Check in Network Settings or
  • Enter ifconfig |grep inet in Terminal

  • Enter computer name and port number: computer-name:port

  • e.g. http://my-macbook-pro.local:1137/path-to-resource.

@yosevu
yosevu / requireContext.js
Created May 28, 2018 20:18
require.context
function importAll(r) {
return r.keys().map(r);
}
const images = importAll(require.context('./', false, /\.(png|jpe?g|svg)$/));
Source: https://stackoverflow.com/questions/42118296/dynamically-import-images-from-a-directory-using-webpack/42118728
@yosevu
yosevu / culture-ships.json
Created May 16, 2018 00:21
Culture Ships
[
[
{
"civ": "Culture",
"type": "GSV",
"name": "Bora Horza Gobuchul",
"class": "Ocean, later Range",
"note":
"The name chosen by the Mind at the centre of the events of the book, after its rescue and emplacement in a GSV."
},
@yosevu
yosevu / web-accessibility-checklist.md
Last active April 23, 2018 14:30
Web Accessibility Checklist
@yosevu
yosevu / object-spread.js
Created April 11, 2018 20:56
Object spread with updated properties
// TIL: When you update an object's properties with the Object spread operator, put the updated properties
// before spreading the object so that the property you are updating isn't reassigned to its original value.
const meat = {
options: [
'crocodile',
'wildebeest',
'ostrich',
'warthog',
'antelope',
@yosevu
yosevu / renderOptions.js
Created April 6, 2018 12:13
Hot Dog Stand in Browser: renderOptions()
// Before
this.renderOptions(item, name, this.menuItems[name]);
renderOptions(item, name, { options, required, onlyOne }) {
options.forEach((option, i) => {
item.innerHTML += `
<label class="option" for="${option}">
<input
id="${option}"
name="${name}"
@yosevu
yosevu / test.md
Created March 5, 2018 18:56
Test

Test

@yosevu
yosevu / ruby-koans-notes.md
Last active March 5, 2018 18:13
Ruby Koans Notes

Ruby Koans Notes

about_classes.rb

  assert_equal 'STRING', "STRING".to_s
  assert_equal '"STRING"', "STRING".inspect
  • open class: a class that is re-declared to add funcitonality
@yosevu
yosevu / git-github-cheatsheet.md
Created January 28, 2018 22:16
Git/GitHub Cheatsheet
  • Never force push to master
  • Never push to master
@yosevu
yosevu / flashing_prompt.rb
Created January 28, 2018 14:21
Flashing prompt
def prompt
60.times do
STDOUT.print "\r:"
sleep 0.5
STDOUT.print "\r "
sleep 0.5
end
end