-
Install the React Developer Tools Chrome Extension.
-
Go to the egghead website, i.e. Getting Started with Redux
-
Click
View -> Developer -> Javascript Console, then theReacttab, then the<NextUpLessonList ...>tag. -
Click back to the
Consoletab, then run:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Array | |
| def to_csv(csv_filename="hash.csv") | |
| require 'csv' | |
| CSV.open(csv_filename, "wb") do |csv| | |
| csv << first.keys # adds the attributes name on the first line | |
| self.each do |hash| | |
| csv << hash.values | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Cocoa | |
| import AVFoundation | |
| // inspiration: https://www.youtube.com/watch?v=1_PUdhLQsZQ | |
| class ViewController: NSViewController { | |
| @IBOutlet weak var videoView: NSView! | |
| private var cameraSession = AVCaptureSession() | |
| private var camera: AVCaptureDevice! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Check if macOS is in dark mode | |
| # Returns "Dark" if dark mode is on, nothing if light mode | |
| DARK_MODE=$(defaults read -g AppleInterfaceStyle 2>/dev/null) | |
| # Path to the active color config file | |
| COLOR_FILE="$HOME/.config/alacritty/color.toml" | |
| if [ "$DARK_MODE" = "Dark" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ wget \ | |
| --recursive \ | |
| --no-clobber \ | |
| --page-requisites \ | |
| --html-extension \ | |
| --convert-links \ | |
| --domains website.org \ | |
| --no-parent \ | |
| www.website.org/tutorials/html/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Software brightness control via hyprsunset | |
| # Usage: brightness up|down|set <value> | |
| # Stores state in ~/.local/state/brightness | |
| # | |
| # Two phases: | |
| # 100% → 15%: reduce gamma (dims the screen while maintaining contrast) | |
| # 15% → 0%: gamma stays at 15%, temperature shifts warm (6500K → 2000K) | |
| # This "dims" further by removing blue light, keeping readability |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'json' | |
| require 'time' | |
| recordings = JSON.parse(ARGF.read) | |
| recordings.each{|recording| | |
| timestamp = Time.at(recording["created"].to_i).strftime("%Y-%m-%d %H.%M.%S") | |
| destination = File.expand_path("#{timestamp}.mp3") | |
| cmd = "curl \"#{recording["url"]}\" > \"#{destination}\"" | |
| puts cmd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ============================================================ | |
| FILM COLLECTION | |
| ============================================================ | |
| CLASSIC/ADULT FILMS (120 titles) | |
| ---------------------------------------- | |
| [ ] 12 Angry Men (1957) | |
| [ ] A Clockwork Orange (1971) | |
| [ ] A Night at the Opera (1935) | |
| [ ] A Place in the Sun (1951) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs"); | |
| if (!fs.existsSync("package.json")) { | |
| console.error( | |
| "Cannot find package.json. Please run this script in your project directory." | |
| ); | |
| process.exit(1); | |
| } | |
| const package = fs.readFileSync("package.json", "utf8"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 11-2-9=0 | |
| 11-3-8=0 | |
| 11-4-7=0 | |
| 11-5-6=0 | |
| 11-6-5=0 | |
| 11-7-4=0 | |
| 11-8-3=0 | |
| 11-9-2=0 | |
| 12-2*6=0 | |
| 12-3-9=0 |
NewerOlder