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
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
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
| grep -rl "ActiveRecord::Migration$" db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[4.2]/g" |
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
| # Ruby version 2.5.0 | |
| # RSPEC version 3.8 | |
| # Running the tests in a console: rspec theorem.rb | |
| # #flatten_array is a recursive method that takes in an array of arbitrary | |
| # nesting elements and returns a flattened array. | |
| # | |
| # Parameters: | |
| # arr:Array The array to flatten |
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
| http://gigi.nullneuron.net/gigilabs/sdl2-pixel-drawing/ |
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
| 1. Go to `http://www.glfw.org/download.html` and download the 32 bit windows binary | |
| 2. In Code::Blocks set the compiler to GNu GCC Compiler. Should be using Mingw32g++ for c++. | |
| 3. Create a new project | |
| 4. Copy the `include` and `lib-mingw` folder from the GLFW folder to the project root. | |
| 5. GO to Project -> Build options | |
| 6. Select the project name from the left tab. | |
| 7. Go to Search Directories tab -> Compiler and add the `include` folder. | |
| 8. Go to Search Directories tab -> Linker and add the `lib-mingw` folder. | |
| 9. Go to linker settings tab and add: | |
| glfw3 |
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
| eyJ2ZXJzaW9uIjoxLjMsImZlYXR1cmVzIjp7ImxvY2F0aW9uIjp7InJvb20iOnRydWUsIm91dHNpZGUiOnRydWUsIndvcmxkIjp0cnVlfX0sInN0b3JlcyI6eyJ3b29kIjo0MjYyNywidGVldGgiOjE1NSwiYmFpdCI6MjQ1NCwiZnVyIjozMjQ3LjUsIm1lYXQiOjEyMDQ4LjUsImNsb3RoIjoyMSwic2NhbGVzIjoxMywiY2hhcm0iOjIsImxlYXRoZXIiOjkwOSwiY3VyZWQgbWVhdCI6NTYsInRvcmNoIjowLCJib25lIHNwZWFyIjoxLCJjb21wYXNzIjoxLCJ3YXRlcnNraW4iOjEsImwgYXJtb3VyIjoxLCJydWNrc2FjayI6MSwiaXJvbiI6MCwiaXJvbiBzd29yZCI6MH0sImNoYXJhY3RlciI6eyJwZXJrcyI6eyJzdGVhbHRoeSI6dHJ1ZX19LCJpbmNvbWUiOnsiZ2F0aGVyZXIiOnsiZGVsYXkiOjEwLCJzdG9yZXMiOnsid29vZCI6MH0sInRpbWVMZWZ0Ijo4fSwiYnVpbGRlciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJ3b29kIjoyfSwidGltZUxlZnQiOjV9LCJodW50ZXIiOnsiZGVsYXkiOjEwLCJzdG9yZXMiOnsiZnVyIjoyOSwibWVhdCI6Mjl9LCJ0aW1lTGVmdCI6NH0sInRyYXBwZXIiOnsiZGVsYXkiOjEwLCJzdG9yZXMiOnsibWVhdCI6LTUsImJhaXQiOjV9LCJ0aW1lTGVmdCI6NH0sInRhbm5lciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJmdXIiOi0xMCwibGVhdGhlciI6Mn0sInRpbWVMZWZ0Ijo1fSwiY2hhcmN1dGllciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJtZWF0IjowLCJ3b29kIjowLCJjdXJlZCBtZWF0IjowfSwidGltZUxlZnQiOjl9fSwi |
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 praw # simple interface to the reddit API, also handles rate limiting of requests | |
| import re | |
| from collections import deque | |
| from time import sleep | |
| USERNAME = "Your username here" | |
| PASSWORD = "Your password here" | |
| USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit" | |
| r = praw.Reddit(USERAGENT) |
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
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> | |
| <div class="map" style="width: 200px; height: 200px; overflow: hidden;"></div> | |
| <div class="tile-template" style="width: 50px; height: 50px; float: left;"></div> | |
| <div class="player" style="color: #fff">@</div> | |
| <script type="text/javascript"> | |
| var Tile = function() { | |
| this.map = [ | |
| [1,1,1,1], | |
| [0,1,1,0], |