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
// gcc rect.c -o rect `sdl-config --cflags` `sdl-config --libs` && ./rect | |
// cflags: -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE | |
// libs: -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa | |
#include "SDL.h" | |
#include <stdbool.h> | |
#include <unistd.h> | |
SDL_Surface *screen; |
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 "SDL.h" | |
#include <stdbool.h> | |
#include <unistd.h> | |
SDL_Surface *screen; | |
SDL_Event event; | |
void Do(void) { | |
screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE); |
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 "SDL.h" | |
#include <stdbool.h> | |
#include <unistd.h> | |
SDL_Surface *screen; | |
SDL_Event event; | |
void Do(void) { | |
SDL_Init(SDL_INIT_VIDEO); |
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
#!/bin/bash | |
set -e | |
cat >fpstest.obn <<EOS | |
MODULE fpstest; | |
(*draw dots and print the number of displayed frames per second*) | |
IMPORT Input, Out, XYplane; | |
VAR |
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
type CustomerId = number | |
type OrderId = number | |
let customerId: CustomerId | |
let orderId: OrderId | |
customerId = 42 | |
orderId = 42 | |
if (customerId == orderId) { |
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
#![allow(dead_code)] | |
#![allow(unused)] | |
fn main() { | |
let add1 = |x| x + 1; // signature is: fn(T) -> T | |
let add = |x, y| x + y; // signature is: fn(T, T) -> T | |
println!("{}", add1(2)); | |
println!("{}", add(2, 3)); |
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
#!/bin/bash | |
set -e | |
# Based on: https://gist.github.com/concatime/265fa14d260f3aa237ddf991d58dd639 | |
mkdir /tmp/setup_sway | |
cd /tmp/setup_sway | |
# === Helpers === |
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
# This is a blocklist to block samsung smart tv's sending meta data at home. | |
# Please help to collect domains! | |
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident. | |
# https://gist.github.com/Perflyst/315f86393712a0c2107ee8eb58c6acee | |
0.0.0.0 device-metrics-us.amazon.com | |
0.0.0.0 samsungacr.com | |
0.0.0.0 samsungcloudsolution.com | |
0.0.0.0 samsungcloudsolution.net | |
0.0.0.0 pavv.co.kr |
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
type customerId = | |
| CustomerId(int); | |
type orderId = | |
| OrderId(int); | |
let cid = CustomerId(42); | |
let oid = OrderId(42); | |
cid == oid; |
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
MODULE IO; (*for Oberon0 NW 29.4.2017*) | |
IMPORT Texts,Oberon; | |
VAR S: Texts.Scanner; W: Texts.Writer; | |
PROCEDURE OpenInput*; | |
BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S) | |
END OpenInput; | |
PROCEDURE ReadInt*(VAR x: LONGINT); | |
BEGIN x := S.i; Texts.Scan(S) |