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 <stdio.h> | |
#include <stdint.h> | |
void main(void) | |
{ | |
char num[4]; | |
const char *lut[] = { num, "Fizz\n", "Buff\n", "FizzBuff\n" }; | |
for (uint32_t i = 1; i <= 100; ++i) { | |
const uint8_t n = !(i % 3) + (2 * !(i % 5)); | |
snprintf(num, sizeof(num), "%d\n", i); |
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
char *ns = "小 さ い む ね by. Cloudef a b a b a B E B E Z U Z U D A D A dooo daaat →"; | |
main(i){int t=8;for(char *n=ns;*n;++n){int s=16e3/(220+*n);unsigned char v[s];read(0,v,s);for(i=0;i<s*(t+(ns[n-ns]!=0?0:100));)putchar(v[i%s]=(v[i%s]+v[++i%s])/2);}} |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <string.h> | |
int main(int argc, char **argv) { | |
long int numbers[5]; | |
long int highest = 0; | |
if (argc < 2 || strlen(argv[1]) < 5) { | |
fprintf(stderr, "5 digits minimum input string must be given\n"); |
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
/* gcc `pkg-config --cflags --libs libsystemd-login` systemd-active-user.c -o systemd-active-user | |
* get current active user id that has process in 'foreground' according to documentation */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
uid_t *uids = NULL, uactiveid = 0; | |
int i, num = sd_get_uids(&uids); |
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
/* gcc -std=c99 -shared -Wl,-soname,libpandorahck.so pandorahck.c -o libpandorahck.so | |
* | |
* Hacks for Open Pandora that should not be normally needed | |
* Will be compiled with glhck if PANDORA option is specified when built with cmake | |
* You can then copy it to your project and launch with LD_PRELOAD=/path/to/libpandorahck.so ./project | |
* | |
* Hacks: | |
* 1. Report that pandora doesn't support libxi to avoid crash on any mouse event. | |
* 2. Grab all input to window to avoid popular Openbox PND keybind conflicts. | |
* (can be disabled with PANDORAHCK_NO_GRAB) |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(int argc, char **argv) | |
{ | |
FILE *f; char buf, buf2[255], read = 0, isScore = 0, *s; | |
if (argc < 1) return EXIT_FAILURE; | |
if (!(f = fopen(argv[1], "rb"))) return EXIT_FAILURE; | |
while (fread(&buf, 1, 1, f) == 1) { |
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
Basic VSM shadow mapping shader | |
-- GLhck.DepthRender.Unpacking.Fragment | |
void main() { | |
float Depth = glhckUnpackHalf(texture2D(GlhckTexture0, GlhckFUV0).st); | |
GlhckFragColor = vec4(Depth, Depth, Depth, 1.0); | |
} | |
-- GLhck.Depth.Packing.Fragment | |
void main() { |
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
# sms through android | |
# $1 = phone number | |
# $@ = message | |
function sms() { | |
[[ -n "$1" ]] || { echo "no number given"; return; } | |
local num="$1"; shift 1; | |
[[ -n "$@" ]] || { echo "no message given"; return; } | |
ssh -q root@hack-ANDROID "am start -a android.intent.action.VIEW -d sms:$num --es sms_body \"$@\" --ez exit_on_sent true" | |
} |
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
glhckObject *ground2 = glhckObjectNew(); | |
unsigned int rows = 16, cols = 16, i, i2, vi, ii; | |
glhckImportVertexData v[rows*cols]; | |
glhckImportIndexData id[rows*cols*2]; | |
memset(id, 0, rows*cols*2*sizeof(glhckImportIndexData)); | |
memset(v, 0, rows*cols*sizeof(glhckImportVertexData)); | |
for (vi = 0, ii = 0, i = 0; i != rows; i++) { | |
id[ii++] = i*cols; | |
for (i2 = 0; i2 != cols; ++i2) { | |
id[ii++] = i*cols+i2; |
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 | |
# color output of -Ss | |
[[ -n "$PACMAN" ]] || { | |
PACMAN="pacman" | |
} | |
C[0]="\033[33m" # core | |
C[1]="\033[34m" # extra | |
C[2]="\033[32m" # community |