Skip to content

Instantly share code, notes, and snippets.

View rajasharan's full-sized avatar

Raja Sharan Mamidala rajasharan

View GitHub Profile
@aaangeletakis
aaangeletakis / How-To-Install-SDL-On-Ubuntu.md
Last active February 20, 2024 17:55
How do I install SDL on ubuntu?

What you need to do to install SDL is:

#install sdl2
sudo apt install libsdl2-dev libsdl2-2.0-0 -y;

#install sdl image  - if you want to display images
sudo apt install libjpeg-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y;

#install sdl mixer  - if you want sound
@cobalamin
cobalamin / HaskellVsElm.md
Last active April 2, 2022 09:19
Elm (0.17) syntax and functionality differences for Haskell programmers
  • Types are declared with : and not ::, and the consing operator conversely is :: instead of :
  • No where clauses, only let/in
  • The standard style is different, check http://elm-lang.org/docs/style-guide for reference
  • Multiline strings are a thing with """
  • Haskell's data corresponds to type in Elm, and also, Haskell's type corresponds to Elm's type alias
  • ($) is (<|), but you don't use it all that much – Elm people like the flipped operator (|>) which lets you build something that reads like a pipeline
  • Related: Backticks will likely die soon in favour of functions that have an argument order that lends itself to pipelining with (|>)
  • Also, (.) is (<<), and a flipped version (>>) exists, but I don't see it used that much either
  • (&gt;&gt;=) is not an available operator and would not be polymorphic (no typeclasses, see below), and is instead commonly named SomeType.andThen – e.g. Maybe.andThen : Maybe a -&gt; (a -&gt; Maybe b) -&gt; Maybe b
@pdamoc
pdamoc / Mario.elm
Created May 8, 2016 20:00
Mario 0.17
import Html exposing (..)
import Keyboard
import Window exposing (Size)
import AnimationFrame
import Task
import Html.App as App
import Collage exposing (..)
import Element exposing (..)
@cb372
cb372 / jargon.md
Last active May 8, 2023 16:03
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@rajanaresh
rajanaresh / app.js
Last active September 17, 2015 21:16
SSL Certificate generation & websockets
var fs = require('fs');
var options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
};
var app = require('https').createServer(options);
var io = require('socket.io')(app);
@chalup
chalup / MultiUriCursorWrapper.java
Created August 13, 2014 18:57
CursorWrapper which a) allows setting multiple notification Uris on a Cursor and b) sets the "dirty" state after ContentResolver notification and dispatches change on ContentObserver registration
package com.futuresimple.base.provider;
import com.google.common.collect.Iterables;
import android.content.ContentResolver;
import android.database.ContentObservable;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.CursorWrapper;
import android.net.Uri;
@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 5, 2024 18:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

// Created by STRd6
// MIT License
// jquery.paste_image_reader.js
(function($) {
var defaults;
$.event.fix = (function(originalFix) {
return function(event) {
event = originalFix.apply(this, arguments);
if (event.type.indexOf('copy') === 0 || event.type.indexOf('paste') === 0) {
event.clipboardData = event.originalEvent.clipboardData;