Skip to content

Instantly share code, notes, and snippets.

View mishalzaman's full-sized avatar

Mishal Zaman mishalzaman

  • Burlington, Ontario
View GitHub Profile
@mishalzaman
mishalzaman / rails http status codes
Created June 2, 2022 13:26 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
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
grep -rl "ActiveRecord::Migration$" db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[4.2]/g"
# 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
http://gigi.nullneuron.net/gigilabs/sdl2-pixel-drawing/
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
eyJ2ZXJzaW9uIjoxLjMsImZlYXR1cmVzIjp7ImxvY2F0aW9uIjp7InJvb20iOnRydWUsIm91dHNpZGUiOnRydWUsIndvcmxkIjp0cnVlfX0sInN0b3JlcyI6eyJ3b29kIjo0MjYyNywidGVldGgiOjE1NSwiYmFpdCI6MjQ1NCwiZnVyIjozMjQ3LjUsIm1lYXQiOjEyMDQ4LjUsImNsb3RoIjoyMSwic2NhbGVzIjoxMywiY2hhcm0iOjIsImxlYXRoZXIiOjkwOSwiY3VyZWQgbWVhdCI6NTYsInRvcmNoIjowLCJib25lIHNwZWFyIjoxLCJjb21wYXNzIjoxLCJ3YXRlcnNraW4iOjEsImwgYXJtb3VyIjoxLCJydWNrc2FjayI6MSwiaXJvbiI6MCwiaXJvbiBzd29yZCI6MH0sImNoYXJhY3RlciI6eyJwZXJrcyI6eyJzdGVhbHRoeSI6dHJ1ZX19LCJpbmNvbWUiOnsiZ2F0aGVyZXIiOnsiZGVsYXkiOjEwLCJzdG9yZXMiOnsid29vZCI6MH0sInRpbWVMZWZ0Ijo4fSwiYnVpbGRlciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJ3b29kIjoyfSwidGltZUxlZnQiOjV9LCJodW50ZXIiOnsiZGVsYXkiOjEwLCJzdG9yZXMiOnsiZnVyIjoyOSwibWVhdCI6Mjl9LCJ0aW1lTGVmdCI6NH0sInRyYXBwZXIiOnsiZGVsYXkiOjEwLCJzdG9yZXMiOnsibWVhdCI6LTUsImJhaXQiOjV9LCJ0aW1lTGVmdCI6NH0sInRhbm5lciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJmdXIiOi0xMCwibGVhdGhlciI6Mn0sInRpbWVMZWZ0Ijo1fSwiY2hhcmN1dGllciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJtZWF0IjowLCJ3b29kIjowLCJjdXJlZCBtZWF0IjowfSwidGltZUxlZnQiOjl9fSwi
@mishalzaman
mishalzaman / LinkFixerClone.py
Created September 8, 2016 14:00 — forked from dmarx/LinkFixerClone.py
A simple LinkFixerBot clone developed as a demonstration for anyone who is curious how a simple reddit bot might be coded. To kill this code, spam "Ctrl+C" until it catches the exception.
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)
@mishalzaman
mishalzaman / tinyJSTileMap.html
Last active April 5, 2016 20:19
A really simple JS map generator
<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],