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 | |
set -e | |
ensure_installed() { | |
command -v $1 >/dev/null 2>&1 || { echo -e >&2 "$1 not found.\nTry: sudo apt-get install $1.\nAborting."; exit 1; } | |
} | |
CFGDIR=$HOME/.encfs | |
CFGFILE=.mountsettings |
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 | |
set -e | |
ensure_installed() { | |
command -v $1 >/dev/null 2>&1 || { echo -e >&2 "$1 not found.\nTry: sudo apt-get install $1.\nAborting."; exit 1; } | |
} | |
function usage() { | |
cat << EOF |
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 | |
set -e | |
BASEURL=http://kernel.ubuntu.com/~kernel-ppa/mainline | |
BUILDIR=${BUILDIR:-$HOME/.build} | |
ARCH=$(dpkg --print-architecture) | |
VERSIONS=$(curl -s $BASEURL/ | sed -n 's/.*href="v\([^/"]*\).*/\1/p' | grep -v rc | sort -t. -k 1,1rn -k 2,2rn -k 3,3rn | head -n 100) |
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 recyclerview.adapter; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.ViewGroup; | |
@SuppressWarnings("unchecked") | |
public class WrapperRecyclerAdapter extends RecyclerView.Adapter { | |
private final RecyclerView.Adapter mAdapter; |
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
public class NastyCustomView extends View implements InteractiveViewHelper.Callback { | |
private final InteractiveViewHelper mInteractiveViewHelper = | |
new InteractiveViewHelper(this, this); | |
@Override | |
protected void onAttachedToWindow() { | |
super.onAttachedToWindow(); | |
mInteractiveViewHelper.onAttachedToWindow(); | |
} |
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 sort(int *a, unsigned size) { | |
void quick_sort(unsigned first, unsigned last) { | |
void swap(unsigned i, unsigned j) { | |
int tmp = a[i]; a[i] = a[j]; a[j] = tmp; | |
} | |
int partition() { | |
int pivot = a[first]; |
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(int *x) { | |
typeof(x) y; // Declares y with the type of x | |
typeof(*x) z; // Declare z with the type what x points to | |
... | |
} |
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
#define max(a,b) \ | |
({ __auto_type _a = (a); \ | |
__auto_type _b = (b); \ | |
_a > _b ? _a : _b; }) |
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
struct pstring { | |
unsigned length; | |
char content[0]; | |
}; | |
struct pstring my_string = (struct pstring *) malloc(sizeof (struct pstring) + my_length); | |
mystring->length = my_length; |
OlderNewer