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
/* How to return a value from a macro */ | |
#define FUNC(num1, num2) ({ \ | |
int __ret; \ | |
do { \ | |
__ret = (num1) < (num2) ? 0 : 1; \ | |
} while (0); \ | |
__ret; \ | |
}) |
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
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h | |
index 870d7ff..5c5dc5b 100644 | |
--- a/arch/arm/include/asm/thread_info.h | |
+++ b/arch/arm/include/asm/thread_info.h | |
@@ -15,8 +15,8 @@ | |
#include <linux/compiler.h> | |
#include <asm/fpstate.h> | |
-#define THREAD_SIZE_ORDER 1 | |
-#define THREAD_SIZE 8192 |
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
# Command: GLOG | |
# Description: alias that creates a nice and easy on eye history log with graph indication of merge commits and branches | |
git config --global alias.glog "\!git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative ; true" | |
# Run: | |
git glog | |
# Command: LASTWORKS | |
# Description: Lists the last 10 branches you worked on | |
git config --global alias.lastworks "for-each-ref --count=10 --sort=-committerdate refs/heads/" |
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 | |
# From Gerrit Code Review 2.1.2-rc2-33-g7e30c72 | |
# | |
# Part of Gerrit Code Review (http://code.google.com/p/gerrit/) | |
# | |
# Copyright (C) 2009 The Android Open Source Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
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
#include <stdio.h> | |
#include <gnu/libc-version.h> | |
int main (void) | |
{ | |
puts(gnu_get_libc_version()); | |
return 0; | |
} |
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
#include <stdio.h> | |
#define CLEAR "\033[00;00;00m" | |
static void p_colour(int c1, int c2) | |
{ | |
char col[10]; | |
sprintf(col, "\033[%d;%dm", c1, c2); | |
printf("\"\\033[%d;%dm\" = %scolour%s\n", c1, c2, col, CLEAR); |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/select.h> | |
#include <stdarg.h> | |
#define CURSOR_DISSABLE "\E[?25l" | |
#define CURSOR_ENABLE "\E[?25h" | |
#define ARRAY_SZ(ARR) (sizeof(ARR) / sizeof(ARR[0])) |
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
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <dirent.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
static int path_scan(char *path) | |
{ | |
DIR *d; | |
struct dirent *ent; |
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
@echo off | |
set MORNING=6:00am-8:00am | |
set SCHOOL=8:00am-1:00pm | |
set AFTERNOON=1:00pm-6:00pm | |
set EVENING=6:00pm-12:00am | |
set NIGHT=12:00am-6:00am | |
set LIMIT=SU-SA,%AFTERNOON%;F,%EVENING%;SA,%MORNING%,%SCHOOL% | |
rem echo MORNING:%MORNING% |
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
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#define ALIGN_OPTIONAL_ARGUMENT(_argc, _argv, _optstring, _optarg, _optind) \ | |
do { \ | |
if (!(_optarg) && (_optind) < (_argc) && \ | |
(((_argv)[(_optind)][0] != '-') || \ | |
!strchr(_optstring, (_argv)[(_optind)][1]))) { \ | |
(_optarg) = (_argv)[(_optind)++]; \ |
OlderNewer