This file contains hidden or 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
| /* | |
| * Copyright (c) 2009-2017, Farooq Mela | |
| * All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions are met: | |
| * | |
| * 1. Redistributions of source code must retain the above copyright | |
| * notice, this list of conditions and the following disclaimer. | |
| * 2. Redistributions in binary form must reproduce the above copyright |
This file contains hidden or 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 | |
| # This way you can customize which branches should be skipped when | |
| # prepending commit message. | |
| if [ -z "$BRANCHES_TO_SKIP" ]; then | |
| BRANCHES_TO_SKIP=(master develop test) | |
| fi | |
| BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
| BRANCH_NAME="${BRANCH_NAME##*/}" |
This file contains hidden or 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
| I have to be frank here, this is going to be | |
| - criticism of thrust | |
| - Showing off ArrayFire (of which I am a core developer) | |
| *Criticism of thrust* | |
| They do a good job at optimizing parallel algorithms for vector inputs. | |
| They use data level parallelism (among other things) to parllelize algorithms that work really well for large, vector inputs. | |
| But they fail to improve upon it and go all the way to perfom true data level parallelism. i.e. a large number of small problems. |
This file contains hidden or 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 | |
| # | |
| # Automatically adds branch name and branch description to every commit message. | |
| # | |
| NAME=$(git branch | grep '*' | sed 's/* //') | |
| DESCRIPTION=$(git config branch."$NAME".description) | |
| TEXT=$(cat "$1" | sed '/^#.*/d') | |
| if [ -n "$TEXT" ] | |
| then |
This file contains hidden or 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
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
This file contains hidden or 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
| //Compile: gcc xgrabkey.c `pkg-config --cflags --libs x11` | |
| #include <stdio.h> | |
| #include <X11/Xlib.h> | |
| int | |
| main () | |
| { | |
| Window root; | |
| Display *dpy = NULL; |
This file contains hidden or 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
| // C/C++ tips for using printf-style functions | |
| // Lots of manipulation can be expressed simply and fast with printf-style formatting | |
| // Also helps reducing the number of temporaries, memory allocations or copies | |
| // ( If you are looking for a simple C++ string class that is printf-friendly and not heap-abusive, | |
| // I've been using this one: https://github.com/ocornut/Str ) | |
| // If you are interested in a FASTER implementation of sprintf functions, see stb_sprintf.h | |
| // https://github.com/nothings/stb/blob/master/stb_sprintf.h | |
| // How to concatenate non-zero terminated strings |
This file contains hidden or 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
| var gulp = require('gulp'); | |
| var exec = require('child_process').exec; | |
| var cmakeCommand = "mkdir -p build; cd build; cmake ..;"; | |
| var cleanCommand = "rm -rf build"; | |
| var testCommand = "cd build; ctest -V"; | |
| //"cmake --build ." |
This file contains hidden or 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
| # checkout, compile & install | |
| git clone https://github.com/facebook/watchman.git | |
| cd watchman/ | |
| git checkout v4.9.0 | |
| sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool | |
| ./autogen.sh | |
| ./configure | |
| make | |
| sudo make install |
This file contains hidden or 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
| FROM ubuntu | |
| RUN apt update \ | |
| && apt install -y firefox \ | |
| openssh-server \ | |
| xauth \ | |
| && mkdir /var/run/sshd \ | |
| && mkdir /root/.ssh \ | |
| && chmod 700 /root/.ssh \ | |
| && ssh-keygen -A \ | |
| && sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \ |
OlderNewer