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 <errno.h> | |
#include <fcntl.h> | |
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/epoll.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <unistd.h> |
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
csv.split('\n').slice(1).filter(e=>e).map(l=>l.split(',')).map(a=>['BEGIN:VCARD','VERSION:2.1','N:'+[a[2],a[0],a[1]].join(';'),...a.slice(11,24).map(m=>`TEL;CELL:`+m),...a.slice(8,11).map(m=>'EMAIL;HOME:'+m),'END:VCARD'].filter(l=>!l.endsWith(':')).join('\n')).join('\n\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
#include <stdio.h> | |
#include <stdint.h> | |
#include <termios.h> | |
#define LEN(ARR) ARR,sizeof(ARR)/sizeof(*ARR) | |
#define RGBA(R,G,B,A) ((R<<24) | (G<<16) | (B<<8) | A) | |
#define RGB(R,G,B) RGBA(R,G,B,255) | |
typedef enum{ | |
RULE_NOP, | |
RULE_TEXT_COLOR, |
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> | |
#define fn(c) ({int _ c;_;}) | |
#define list(c) sizeof(c)/sizeof(*c),c | |
#define map(LIST, CB) _Generic( (CB), int(*)(int, int, int*): map_arr, int(*)(int): map_val)(list(LIST), CB) | |
int map_val(size_t total, int *array, int (*cb)(int)) { | |
for(int i = 0; i < total; i++) | |
array[i] = cb(array[i]); | |
} | |
int map_arr(size_t total, int *array, int (*cb)(int, int, int*)) { |
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 -x | |
until sudo apt -y update && sudo apt -y upgrade ; do sleep 10; done | |
crontab -l | grep -q .wall || (echo '0 * * * * ID=$(curl -sL gist.githubusercontent.com/yne/729655bd0557bfde7a088e15b40b9e6d/raw/ | shuf -n 1);for t in jpg png; do curl -sfL nik.bot.nu/o$ID.$t -o "$HOME/.wall"; done') | crontab - | |
# MS-EDGE | |
REPO_EDGE='https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-dev/' | |
LAST_EDGE=$(wget -qO- "$REPO_EDGE" | grep -o '[.a-z_0-9-]*.deb' | tail -n1) | |
wget -O /tmp/edge_amd64 "$REPO_EDGE/$LAST_EDGE" | |
# VSCode (will add itself to apt.list) |
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 <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <fcntl.h> | |
#include <netinet/in.h> | |
#include <ctype.h> | |
#include "miniwget.h" | |
#include "miniupnpc.h" | |
#include "upnpcommands.h" |
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 <inttypes.h> | |
#include <stdio.h> | |
//#include "klist.h" | |
#include "khash.h" | |
#define kh_forall(h) for(khint_t __i=kh_begin(h);__i!=kh_end(h);++__i)if(kh_exist(h,__i)) | |
#define kh_diff(name, old, new, on_add, on_keep, on_del)\ | |
kh_forall(new){/*find added(exist in new, not in old) and kept(exist in both) entries */\ | |
khiter_t __j = kh_get(name, old, kh_key(new,__i));\ | |
if((__j==kh_end(old))||(!kh_exist(old,__j))){on_add;}else{on_keep;}\ |
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
#http://d{u,e,o}01{,b}.psp.update.playstation.org/update/psp/image{,2}/{eu,us}/$date_$md5/EBOOT.PBP | |
6be8878f475ac5b1a499b95ab2f7d301 6.61 | |
2011_0810 2ca64d59dcf48f45fb99b400a586b395 6.60 | |
ccce1a0f3ba08e22c26ec5bc047a0063 6.39 | |
d033298a1de455a5d90e06f91c6802f6 6.38 | |
2011_0120 5a21c511c90ed765747c43a9779f7a4b 6.37 | |
bcac2b0a4ac55378f300386391e4bb37 6.36 | |
2010_1124 5945c21abfa5b1221adda745f9417668 6.35 | |
2010_0729 d7ea54162d2d53c5efb46648ee12f6bc 6.31 |
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 <json-c/json.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stddef.h> | |
typedef enum{ | |
diff_none, | |
diff_type, | |
diff_value, | |
diff_removed, |
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 <sys/ioctl.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#define POS(ROW,COL) printf("\033[%i;%iH", ROW, COL) | |
struct winsize w; |