$ cp clangshebang.cpp myprogram.cpp
$ chmod +x myprogram.cpp
$ ./myprogram.cpp
hello shell
This file contains 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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "(lldb) Launch", | |
"type": "cppdbg", | |
"request": "launch", |
This file contains 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
let print = console.log | |
let closure = null | |
try { | |
let x = 42 | |
let y = null | |
closure = (msg) => { | |
x = x + 1 |
Regarding best practices, code design, and such I think we're better off than we were with early "proper" OO design--I doubt anyone truly needs an AbstractSingletonProxyBeanFactory. :P
I think the fact that folks kept trying to turn browsers into a replacement for OS services (ui/media/input/network) sort of necessitates a return to good practices, and we're seeing that with TypeScript's popularity.
I'm not sure how to factor the whole left-pad / `npm install
This file contains 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
Process: dotnet [6878] | |
Path: /usr/local/share/dotnet/dotnet | |
Identifier: dotnet | |
Version: 0 | |
Code Type: X86-64 (Native) | |
Parent Process: zsh [6772] | |
Responsible: dotnet [6878] | |
User ID: 501 | |
Date/Time: 2017-07-23 01:27:55.613 -0700 |
This file contains 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
;; Based on http://stackoverflow.com/questions/6497374/emacs-cc-mode-indentation-problem-with-c0x-enum-class/6550361#6550361 | |
;; Gist from the SO answer: https://gist.github.com/nschum/2626303 | |
; I know it's a disgusting regex, I'm sorry. I kept the source that generated it. | |
(defun my/inside-class-enum-p (pos) | |
"Checks if POS is within the braces of a C++ \"enum class\"." | |
(ignore-errors | |
(save-excursion | |
(goto-char pos) |
This file contains 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
# an idea | |
from sqlalchemy.engine import ResultProxy | |
from typing import TypeVar, List, Generic, Optional, Union | |
T = TypeVar('T') | |
class TypeMappingCursor(Generic[T]): | |
@classmethod | |
def from_auto(cls: type, mapping_function_or_type: Any, result_proxy: ResultProxy) -> cls: |
This file contains 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 functools | |
import inspect | |
import marshmallow | |
class ParamConverter: | |
__slots__ = ('converter_func',) | |
def __init__(self, converter): | |
if not callable(converter): |
This file contains 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
ag --nobreak --nofilename --nogroup '\Wm_Layer: \d+$' | | |
sed -E 's/[ \t]*m_Layer: ([0-9]+)/\1/g' | | |
python3 -c 'import sys; \ | |
used_layers = frozenset(map(int, sys.stdin.readlines())); \ | |
free_layers = sorted([layer for layer in (frozenset(range(32)) - used_layers) if layer > 7]); \ | |
print("Free layers:", ", ".join(map(str, free_layers)))' |
This file contains 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
void foo_base() | |
{ | |
printf("fool\n"); | |
} | |
#define FooFunction foo_base |