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
| ; ######################################################################### | |
| .386 | |
| .model flat, stdcall | |
| option casemap :none | |
| ; ######################################################################### | |
| include windows.inc |
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
| #include <Wire.h> | |
| #include <LiquidCrystal.h> | |
| #define LCD_WIDTH 16 | |
| #define LCD_HEIGHT 2 | |
| #define LCD_SIZE (LCD_WIDTH * LCD_HEIGHT) | |
| class LCDDoubleBuffer { |
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
| #include <stdlib.h> | |
| #include <cairo/cairo.h> | |
| #include <gtk/gtk.h> | |
| #include <gdk/gdk.h> | |
| #define N_VERTS 5 | |
| #define WIN_WIDTH 1024 |
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
| #!/usr/bin/env ruby | |
| require 'base64' | |
| require 'openssl' | |
| common = { | |
| :key_length => 4096, | |
| :digest_func => OpenSSL::Digest::SHA256.new | |
| } |
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
| #include <alloc.h> | |
| #include <conio.h> | |
| #include <stdlib.h> | |
| #define VIDEO_MODE_MCGA 0x13 | |
| #define VIDEO_MODE_TEXT 0x03 | |
| #define PARTICLE_COUNT 1000 |
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 Control.Concurrent | |
| import Control.Concurrent.MVar | |
| main :: IO () | |
| main = do | |
| -- create an empty mvar | |
| m <- newEmptyMVar | |
| -- get another thread to put a value in it | |
| forkIO $ putMVar m "A value" |
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
| {-# LANGUAGE TemplateHaskell #-} | |
| import Control.Lens | |
| data Ball = Ball { _position :: (Double, Double), _velocity :: (Double, Double) } | |
| deriving (Show) | |
| -- create the accessors for the Ball type | |
| makeLenses ''Ball |
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 Control.Monad.State | |
| -- | Starts a value off. | |
| -- This function doesn't perform any calculation at all, it just prepares an | |
| -- initial value to start in the calculation pipeline | |
| -- | |
| start :: Int -> State [String] Int | |
| start x = do | |
| put ["Starting with " ++ show x] | |
| return x |
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 Control.Monad.Writer | |
| -- | Starts a value off. | |
| -- This function doesn't perform any calculation at all, it just prepares an | |
| -- initial value to start in the calculation pipeline | |
| -- | |
| start :: Int -> Writer [String] Int | |
| start x = do | |
| tell (["Starting with " ++ show x]) | |
| return x |
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 Control.Monad.Reader | |
| -- | Shared configuration for this application. | |
| -- Rather trivial (and useless), it just configures how our application will | |
| -- address the user | |
| -- | |
| data SalutationConfig = SalutationConfig { formal :: Bool } | |
| -- | Returns a greeting | |
| -- Takes in someone's name and returns a greeting string |