Function for get random items.
get randomly starwars names
Get randomly generated wisdom to help you through your day.
Generate a unique character string suitible for use in files and URLs.
[](https://www.npmjs.com/package/@aws-sdk/endpoint-cache) [](https://www.npmjs.com/package/@aws-sdk/e
Wrapper around an Elliptic Curve private or public keys
Get the size of a folder by iterating through its sub-files and -folders.
Universal Module for HKDF (Hash-based Key Derivation Function) in JavaScript
Read binary packets...
OpenTelemetry propagation package for Google Cloud Trace format
Get and robustly cache all JS language-level intrinsics at first require time
A universally-unique, lexicographically-sortable, identifier generator
Node.js library for parsing crontab instructions
callback port number picked randomly.
Robustly get the [[Prototype]] of an object
Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.
High-performance 2D spatial index for rectangles (based on R*-tree with bulk loading and bulk insertion algorithms)
Universal Module for Secure Random Generator in JavaScript
Provide automatic message signing (no user interaction) using a pseudo randomly generated private key
Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines.
Find and parse the tsconfig.json file from a directory path
Shared TypeScript definitions for Octokit projects
Get a stream as a string, Buffer, ArrayBuffer or array
Parser and generator for CSS color strings
ImageSuckr is a ruby gem that allows you to get random images from Google for seeding purposes.
I took an online course from Pragmatic Studio and built this game that takes multiple players and they randomly get w00ted or blammed and randomly accumulate treasure.
Select multiple choice or boolean questions from a category, or get them randomly.
THIS IS A GAME WHERE YOU INPUT THE PLAYERS AND NUMBER OF ROUNDS AND THEY RANDOMLY GET THEIR HEALTH, SCORE, POINTS AND TREASURES PRINTED TO THE SCREEN.
A Seq is created with an array, and optionally a number of elements to return, an offset to start at and a default item to return when ended. Call #next to return the next item. A Seq::Random will return randomly selected elements from the array. A Seq::Lazy will lazily evaluate a block to get the next element.
This gem is made following the Ruby Course of Pragmatic Studio on online.pragmaticstudio.com. The game is used to run a game "studio_game" with players and rounds. Each round a player finds a random treasure and randomly gets healed (w00ted) or damaged (blammed).
Twitterpunch =============== Twitterpunch is designed to work with PhotoBooth and OS X Folder Actions. When this script is called with the name of an image file, it will post the image to Twitter, along with a message randomly chosen from a list and a specified hashtag. If you call the script with the `--stream` argument instead, it will listen for tweets to that hashtag and download them to a specified directory. If the tweet came from another user, Twitterpunch will speak it aloud. Typically, you'll run one copy on an OSX laptop with PhotoBooth, and a separate copy on another machine (either Windows or OSX) for the viewer. You can also use a mobile device as a remote control, if you like. This will allow the user to enter a custom message for each photo that gets tweeted out, if they'd like. Configuration =========== Configure the program via the `~/.twitterpunch/config.yaml` YAML file. This file should look similar to the example below. --- :twitter: # twitter configuration :consumer_key: <consumer key> :consumer_secret: <consumer secret> :access_token: <access token> :access_token_secret: <access secret> :messages: # list of messages to attach - Hello there # to outgoing tweets - I'm a posting fool - minimally viable product :hashtag: Twitterpunch # The hashtag to post and listen to :handle: Twitterpunch # The twitter username to post as :photodir: ~/Pictures/twitterpunch/ # Where to save downloaded images :logfile: ~/.twitterpunch/activity.log # Where to save logs :viewer: # Use the built-in slideshow viewer :count: 5 # How many images to have onscreen at once :remote: :timeout: 45 # How long the button should remain disabled for :apptitle: dslrBooth # The photo booth application title :hotkey: space # Which hotkey to send to trigger a photo 1. Generate a skeleton configuration file * `twitterpunch --configure` 1. Edit the configuration file as needed. You'll be prompted with the path. * If you have your own Twitter application credentials, you're welcome to use them. 1. Authorize the application with the Twitter API. * `twitterpunch --authorize` Usage ========== ### Using OS X PhotoBooth 1. Start PhotoBooth at least once to generate its library. 1. Install the Twitterpunch Folder Action * `twitterpunch --install` * It may claim that it could not be attached, fear not. 1. Profit! * _and by that, I mean take some shots with PhotoBooth!_ *Note*: if the folder action doesn't seem to work and photos aren't posted to Twitter, here are some troubleshooting steps to take: 1. Run Twitterpunch by hand with photos as arguments. This may help you isolate configuration or authorization issues. * `twitterpunch foo.jpg` 1. Correct the path in the workflow. * `which twitterpunch` * Edit the Twitterpunch folder action to include that path. #### Using the remote web app Configure the remote web app using the `:remote` hash in `config.yaml`. You can usually find the title of the app using `system_profiler -detailLevel full SPApplicationsDataType` and grepping for the name or path to the `.app`. In this example, the title is _dslrBooth_. [ben@ganymede] ~ $ system_profiler -detailLevel full SPApplicationsDataType | grep -B8 dslrBooth.app dslrBooth: Version: 2.9 Obtained from: Identified Developer Last Modified: 10/14/17, 9:50 PM Kind: Intel 64-Bit (Intel): Yes Signed by: Developer ID Application: Hope Pictures LLC (MZR5GHAQX4), Developer ID Certification Authority, Apple Root CA Location: /Applications/dslrBooth.app 1. Run the app with `twitterpunch --remote` 1. Browse to the app with http://{address}:8080 1. [optional] If on an iOS device, add to your homescreen * This will give you "app behaviour", such as full screen, and a nice icon #### Troubleshooting. 1. Make sure the folder action is installed properly 1. Use the Finder to navigate to `~/Pictures/` 1. Right click on the `Photo Booth Library` icon and choose _Show Package Contents_. 1. Right click on the `Pictures` folder and choose `Services > Folder Actions Setup` 1. Make sure that the `Twitterpunch` action is attached. 1. Install the folder action 1. Open the `resources` folder of this gem. * Likely to be found in `/Library/Ruby/Gems/{version}/gems/twitterpunch-#{version}/resources/`. 1. Double click on the `Twitterpunch` folder action and install it. * It may claim that it could not be attached, fear not. ### Using something besides PhotoBooth Configure the program you are using for your photo shoot to call Twitterpunch each time it snaps a photo. Pass the name of the new photo as a command line argument. Alternatively, you could batch them, as Twitterpunch can accept multiple files at once. [ben@ganymede] ~ $ twitterpunch photo.jpg [photo2.jpg photo3.jpg photo4.jpg] You can manually install the Folder Action, or you can follow the automated install process after tweaking the workflow slightly. 1. Identify where the app stores the resulting image files. 1. Edit the Twitterpunch folder action to include that path. 1. Follow the steps above to install the Folder Action. ### Viewing the Twitter stream Twitterpunch will run on OS X or Windows equally well. Simply configure it on the computer that will act as the Twitter display and then run in streaming mode. [ben@ganymede] ~ $ twitterpunch --stream There are two modes that Twitterpunch can operate in. 1. If a `:hashtag` is defined then all images tweeted to the configured hashtag will be displayed in the slideshow. 1. Otherwise, Twitterpunch will stream the `:handle` Twitter user's stream and display all images either posted by that user or addressed to that user. With protected tweets, you can have rudimentary access control. In either mode, tweets that come from any other user will also be spoken aloud. If you don't want to use the built-in slideshow viewer, you can disable it by removing the `:viewer` key from your `~/.twitterpunch/config.yaml` config file. Twitterpunch will then simply download the tweeted images and save them into the `:photodir` directory. You can then use anything you like to view them. There are currently two decent viewing options I am aware of. * Windows background image: * Configure the Windows background to randomly cycle through photos in a directory. * Hide desktop icons. * Hide the taskbar. * Disable screensaver and power savings. * Drawbacks: You're using Windows and you have to install Ruby & RubyGems manually. * OS X screensaver: * Choose one of the sexy screensavers and configure it to show photos from the `:photodir` * Set screensaver to a super short timeout. * Disable power savings. * Drawbacks: The screensaver doesn't reload dynamically, so I have to kick it and you'll see it reloading each time a new tweet comes in. Limitations =========== * It currently requires manual setup for Folder Actions. * Rubygame is kind of a pain to set up. Contact ======= * Author: Ben Ford * Email: binford2k@gmail.com * Twitter: @binford2k * IRC (Freenode): binford2k
## Studio Game Demo App I made this app following along with The Pragmatic Studio's Ruby course found here: https://pragmaticstudio.com/courses/ruby. ## Install the gem I published the gem for this app on RubyGems.org. In order to install it, run `gem install studio_game_dylan_attal-1.0.0.gem` ## Run the app In order to run the app run the following command `studio_game` ## Summary This is a console app that simulates a game. Players are loaded from the `players.csv` file be default. Each player has a name and a starting health value, i.e.: `Larry,100` If the user wants, they can provide a different CSV file to load the players. For example, I've provided a file `my_favorite_players.csv` as an alternate list of players. The user should provide the file like so `studio_game bin/my_favorite_players.csv` Before the game is played, the user gets to decide how many rounds to play. At this point, the user can also terminate the program by typing in `quit` or `exit`: `How many game rounds? ('quit to exit')` Once the user provides the number of rounds, the game is played automatically. The user then sees 1. Which players are involved ``` There are 5 players in Knuckleheads: I'm Boba with a health = 100, points = 0, and score = 100. I'm Jango with a health = 90, points = 0, and score = 90. I'm Din with a health = 80, points = 0, and score = 80. I'm Klutz with a health = 105, points = 0, and score = 105. I'm Berserker with a health = 50, points = 0, and score = 50. ``` 2. Which treasures there are to find ``` There are 6 treasures to be found: A pie is worth 5 A bottle is worth 25 A hammer is worth 50 A skillet is worth 100 A broomstick is worth 200 A crowbar is worth 400 ``` 3. The results of each round ``` Round 1 Rolled a 3 (StudioGame::Die) Rolled a 4 (StudioGame::Die) Boba has been skipped Boba found a skillet worth 100 points. Boba's treasures: {:skillet=>100} I'm Boba with a health = 100, points = 100, and score = 200. Rolled a 3 (StudioGame::Die) Rolled a 2 (StudioGame::Die) Jango got blammed! Jango found a bottle worth 25 points. Jango's treasures: {:bottle=>25} I'm Jango with a health = 80, points = 25, and score = 105. Rolled a 1 (StudioGame::Die) Rolled a 6 (StudioGame::Die) Din got w00ted! Din found a crowbar worth 400 points. Din's treasures: {:crowbar=>400} I'm Din with a health = 95, points = 400, and score = 495. Rolled a 1 (StudioGame::Die) Rolled a 4 (StudioGame::Die) Klutz has been skipped Klutz found a bottle worth 12.5 points. Klutz's treasures: {:bottle=>12.5} I'm Klutz with a health = 105, points = 12.5, and score = 117.5. Rolled a 1 (StudioGame::Die) Rolled a 4 (StudioGame::Die) Berserker has been skipped Berserker found a hammer worth 50 points. Berserker's treasures: {:hammer=>50} I'm Berserker with a health = 50, points = 50, and score = 100. ``` Once the user quits, they see the final results of all the rounds: ``` How many game rounds? ('quit to exit') quit Knuckleheads Statistics: 2 strong players: Boba (115) Klutz (120) 3 wimpy players: Jango (85) Din (75) Berserker (40) Berserker........... 690 Boba................ 620 Din................. 575 Jango............... 235 Klutz............... 207.5 Boba's point totals: 100 total skillet points 5 total pie points 400 total crowbar points 505 grand total points Jango's point totals: 50 total bottle points 100 total skillet points 150 grand total points Din's point totals: 400 total crowbar points 100 total hammer points 500 grand total points Klutz's point totals: 12.5 total bottle points 25.0 total hammer points 50.0 total skillet points 87.5 grand total points Berserker's point totals: 50 total hammer points 200 total broomstick points 400 total crowbar points 650 grand total points ``` ## Rules of the game Each round, each player rolls the die. If a player rolls between 1 and 2, then they are `blammed`, meaning they lose `10 health`. If a player rolls between 3 and 4, then they are `skipped`, meaning they do not gain or lose points that turn. If a player rolls between 5 and 6, then they are `w00ted`, meaning they gain `15 health`. Each round, players can find treasure worth different points. Treasures are found randomly. Every game, there are two special players added: 1. `ClumsyPlayer`: this player's treasure points are cut in half. 2. `BerserkPlayer`: once this player is `w00ted` five times, it cannot be `blammed` in that game anymore—if this player rolls between 1 and 2, they are `w00ted` instead of `blammed`.
No description provided.
No description provided.
No description provided.
No description provided.