Skip to content

Instantly share code, notes, and snippets.

💾
Dat Data Tho

Andres Lowrie andres-lowrie

💾
Dat Data Tho
Block or report user

Report or block andres-lowrie

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
@jdarpinian
jdarpinian / executable.c
Last active Feb 22, 2020
Add one line to your C/C++ source to make it executable.
View executable.c
///bin/true;COMPILER_OPTIONS="-g -Wall -Wextra --std=c99 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@"
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}
@orenitamar
orenitamar / Dockerfile
Last active Feb 4, 2020
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
View Dockerfile
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
@revolunet
revolunet / python-es6-comparison.md
Last active Feb 12, 2020
# Python VS ES6 syntax comparison
View python-es6-comparison.md

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
View global-gitignore.md

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
@thomas11
thomas11 / gist:2909362
Created Jun 11, 2012
Log memory usage every n seconds in Go #golang
View gist:2909362
import (
"runtime"
"time"
)
...
go func() {
for {
var m runtime.MemStats
You can’t perform that action at this time.