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
#ifdef SHELL | |
gcc -Wall -Werror $0 && ./a.out | |
exit $? | |
#endif | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdlib.h> |
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
#ifdef SHELL | |
g++ -Wall -Werror -g -I../../cclib/rapidjson/include $0 && ./a.out | |
exit 0 | |
#endif | |
// Output is: | |
// {"project":"rapidjson","stars":11} | |
// {"Name":"XYZ","Rollnumer":2,"array":["hello","world"],"Marks":{"Math":"50","Science":"70","English":"50","Social Science":"70"}} | |
// {"FromEmail":"sender@gmail.com","FromName":"Sender's name","Subject":"My subject","Recipients":[{"Email":"recipient@gmail.com"}],"Text-part":"this is my text"} |
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
#include "log.h" | |
unsigned char log_run_level = LOG_LVL_DEBUG; | |
const char * log_level_strings [] = { | |
"NONE", // 0 | |
"CRIT", // 1 | |
"WARN", // 2 | |
"NOTI", // 3 | |
" LOG", // 4 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<properties> | |
<property name="name">app</property> | |
<property name="pattern">%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5.5p | %-10.10t | %-20.20C:%-5.5L | %msg%n</property> | |
<!-- | |
It will look like that: | |
2013-04-03 07:37:51.993 | WARN | main | lnetgateway.Server:56 | My app is logging stuff | |
--> | |
</properties> |
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
package ginlogger | |
// Directly inspired from the default gin.Logger | |
// This is to be used like this: | |
// r := gin.New() | |
// r.Use(gin.Recovery()) | |
// r.Use(ginlogger.LoggerWithGoKit(mylogger)) | |
import ( |
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
#ifdef SHELL | |
gcc -Wall -Werror $0 && ./a.out | |
exit $? | |
#endif | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <limits.h> | |
#define DIJ_MAX_PATHS 10 |
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
#ifdef __SHELL__ | |
set -ex | |
if [ "$0" = "sh" ]; then | |
curl https://gist.githubusercontent.com/fclairamb/0387016387c5474e06476f0a84b6ad86/raw/round.cpp > round.cpp && \ | |
chmod a+rx round.cpp && \ | |
./round.cpp | |
exit $? | |
fi | |
BIN=test-$(arch) |
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
#!/bin/sh -x | |
# === ARGUMENTS PARSING === | |
# We don't want to define a default period | |
PERIOD= | |
while echo $1 | grep ^- > /dev/null; do | |
if [ "$1" = "--daily" ]; then |
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
MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) | |
panic(cpu 0 caller 0xffffff8021ac2838): nvme: "Fatal error occurred. ID=0xffffffff ARG1=0xffffffff ARG2=0xffffffff ARG3=0xffffffff EDD0=0xffffffff EDD1=0xffffffff EDD2=0xffffffff EDD3=0xffffffff EDD4=0xffffffff EDD5=0xffffffff EDD6=0xffffffff EDD7=0xffffffff NANDV=0x2, DRAMV=0x2, SSDC=512GB. FW Revision=16.14.01\n"@/System/Volumes/Data/SWE/macOS/BuildRoots/2288acc43c/Library/Caches/com.apple.xbs/Sources/IONVMeFamily/IONVMeFamily-557.100.13/Common/IONVMeController.cpp:5499 | |
Backtrace (CPU 0), Frame : Return Address | |
0xffffffb0f5443960 : 0xffffff801f28e02d | |
0xffffffb0f54439b0 : 0xffffff801f3d48e3 | |
0xffffffb0f54439f0 : 0xffffff801f3c4eda | |
0xffffffb0f5443a40 : 0xffffff801f232a2f | |
0xffffffb0f5443a60 : 0xffffff801f28d84d | |
0xffffffb0f5443b80 : 0xffffff801f28db43 |
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
#!/bin/bash | |
# The binary is most likely to have the current directory name | |
PROCESS=${PWD##*/} | |
# We kill the previous process | |
killall ${PROCESS} | |
# We launch the process | |
go build |
NewerOlder