Skip to content

Instantly share code, notes, and snippets.

View shenlebantongying's full-sized avatar

shenleban tongying shenlebantongying

View GitHub Profile
@Metaxal
Metaxal / select-or-send-sexp.rkt
Last active February 17, 2022 12:59
Send the current s-expression to the interactions window (quickscript)
#lang racket/base
(require quickscript
racket/list
racket/class
framework
racket/gui/base)
;;; Author: Laurent Orseau https://github.com/Metaxal
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
@pdarragh
pdarragh / papers.md
Last active April 17, 2024 19:29
Approachable PL Papers for Undergrads

Approachable PL Papers for Undergrads

On September 28, 2021, I asked on Twitter:

PL Twitter:

you get to recommend one published PL paper for an undergrad to read with oversight by someone experienced. the paper should be interesting, approachable, and (mostly) self-contained.

what paper do you recommend?

@robin-a-meade
robin-a-meade / unofficial-bash-strict-mode.md
Last active June 17, 2024 15:33
Unofficial bash strict mode

Unofficial Bash Strict Mode

Sometimes a programming language has a "strict mode" to restrict unsafe constructs. E.g., Perl has use strict, Javascript has "use strict", and Visual Basic has Option Strict. But what about bash? Well, bash doesn't have a strict mode as such, but it does have an unofficial strict mode:

set -euo pipefail

set -e

@briandfoy
briandfoy / briandfoy.sublime-color-scheme
Last active April 22, 2022 10:51
The sublime-text color scheme that I like
/*
Put this in ~/.config/sublime-text-3/Packages/User
*/
{
"name": "briandfoy",
"author": "brian d foy <brian.d.foy@gmail.com>",
"variables":
{
"black": "hsl(0,0%,0%)",
@gitaarik
gitaarik / git_submodules.md
Last active June 22, 2024 12:31
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@hi2p-perim
hi2p-perim / ssecheck.cpp
Last active June 16, 2024 06:55
Check SSE/AVX instruction support.
/*
Check SSE/AVX support.
This application can detect the instruction support of
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX.
*/
#include <iostream>
#ifdef _MSC_VER
#include <intrin.h>
#endif
@koute
koute / opengl3_hello.c
Created November 9, 2013 23:16
Minimal SDL2 + OpenGL3 example.
/*
Minimal SDL2 + OpenGL3 example.
Author: https://github.com/koute
This file is in the public domain; you can do whatever you want with it.
In case the concept of public domain doesn't exist in your jurisdiction
you can also use this code under the terms of Creative Commons CC0 license,
either version 1.0 or (at your option) any later version; for details see:
http://creativecommons.org/publicdomain/zero/1.0/
@gjorquera
gjorquera / console.cpp
Last active February 4, 2024 12:44
Qt way to read from stdin.
#include <iostream>
#include "console.hpp"
void Console::run()
{
std::cout << "First message" << std::endl;
std::cout << "> " << std::flush;
connect(m_notifier, SIGNAL(activated(int)), this, SLOT(readCommand()));
}