Skip to content

Instantly share code, notes, and snippets.

ridiculousfish

Block or report user

Report or block ridiculousfish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View longobject.c.h
static PyObject *
long_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"", "base", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "int", 0};
PyObject *argsbuf[2];
PyObject * const *fastargs;
Py_ssize_t nargs = PyTuple_GET_SIZE(args);
Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
View gist:c2f594a7491729dc7ab4a05ad42135ba
static PyObject *
long_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"", "base", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "int", 0};
PyObject *argsbuf[2];
PyObject * const *fastargs;
Py_ssize_t nargs = PyTuple_GET_SIZE(args);
Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
View compile_commands.json
[
{
"directory": "/Users/peter/build_fish",
"command": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DBINDIR=L\\\"/usr/local/bin\\\" -DCMAKE_BINARY_DIR=\\\"/Users/peter/build_fish\\\" -DCMAKE_SOURCE_DIR=\\\"/Users/peter/github/fish-shell\\\" -DDATADIR=L\\\"/usr/local/share\\\" -DDOCDIR=L\\\"/usr/local/share/doc/fish\\\" -DLOCALEDIR=\\\"/usr/local/share/locale\\\" -DPREFIX=L\\\"/usr/local\\\" -DSYSCONFDIR=L\\\"/usr/local/etc\\\" -D_REENTRANT -D_UNICODE=1 -I. -I/usr/local/include -fdiagnostics-color=always -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fno-exceptions -o CMakeFiles/fish_macapp.dir/osx/osx_fish_launcher.m.o -c /Users/peter/github/fish-shell/osx/osx_fish_launcher.m",
"file": "/Users/peter/github/fish-shell/osx/osx_fish_launcher.m"
},
{
"directory": "/Users/peter/build_fish",
"command": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/b
View c_cpp_properties.json
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
],
"defines": [],
View gist:652f6fb05e03bc76e110c4adc1d9ecc7
complete(1) fish complete(1)
NNAAMMEE
complete
ccoommpplleettee -- eeddiitt ccoommmmaanndd ssppeecciiffiicc ttaabb--ccoommpplleettiioonnss
SSyynnooppssiiss
ccoommpplleettee ( -c | --command | -p | --path ) COMMAND
View charlist.cpp
#include <memory>
#include <string>
struct CharList {
char c;
std::unique_ptr<CharList> next;
explicit CharList(char c) : c(c) {}
};
CharList make_list(const std::string &s) {
View gist:740ac4891b2d442aba9d91bdeb027d4c
#!/usr/bin/env sh
# Originally from the git sources (GIT-VERSION-GEN)
# Presumably (C) Junio C Hamano <junkio@cox.net>
# Reused under GPL v2.0
# Modified for fish by David Adam <zanchey@ucc.gu.uwa.edu.au>
set -e
# Find the fish git directory as two levels up from script directory.
GIT_DIR="$( cd "$( dirname $( dirname "$0" ) )" && pwd )"
View burn.cpp
#include <string>
#include <sys/types.h>
#include <pwd.h>
#include <uuid/uuid.h>
#include <vector>
#include <thread>
static size_t burn() {
size_t ret = 0;
setpwent();
@ridiculousfish
ridiculousfish / width.c
Created Jun 23, 2018
wcwidth of variation selector
View width.c
#include <wchar.h>
#include <stdio.h>
#include <locale.h>
int main(void) {
char *loc = setlocale(LC_ALL, "");
printf("%s %d\n", loc, wcwidth(0xFE0F));
return 0;
}
View g++ vs clang
#include <stdio.h>
#include <functional>
void func(std::function<void(void)> func) {
printf("func1\n");
}
template<typename ANYTHING>
static void foo() {
func([](){});
You can’t perform that action at this time.