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
static size_t count_segment(char const *s, char c) | |
{ | |
size_t counter = 0; | |
int i = 0; | |
while (s[i]) | |
{ | |
if (s[i] == c) | |
{ | |
i++; | |
continue; |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /usr/share/cgit; | |
try_files $uri @cgit; | |
location ~ /.+/(info/refs|git-upload-pack) { | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; |
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
#!/usr/bin/awk -f | |
# Markov chain exercice from chapter 3 (design) of the book The practice of programming. | |
BEGIN { | |
PREFIX_LEN = 2 | |
# need space to detect is the end since other words can't have spaces in them | |
SUFFIX_END = "< END >" | |
# maximum number of words in the output | |
MAX_WORDS = 1000 |
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
#!/usr/bin/python3 | |
import os | |
import sys | |
import itertools | |
import requests | |
from bs4 import BeautifulSoup | |
url_fmt = "https://www.omgbeaupeep.com/comics/Avatar_The_Last_Airbender/{:03}/{}/" | |
dir_name = "avatar_comics" |
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 | |
[ $# -eq 0 ] && echo "Usage $0 REPOSITORY ..." && exit 1 | |
for repo in $@; do | |
if [ ! -d $repo ] || [ ! -d $repo/.git ]; then | |
echo "$repo: Is not a repository" | |
continue | |
fi |
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 | |
[ $# -eq 0 ] && echo "Usage: $0 name" && exit 1 | |
repo="/var/www/git/$1.git" | |
ssh git@cacharle.xyz <<EOF | |
mkdir $repo && | |
cd $repo && | |
git init --bare |
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 | |
[ $# -eq 0 ] && echo "Usage $0 REPOSITORY ..." && exit 1 | |
for repo in $@; do | |
if [ ! -d $repo ] || [ ! -d $repo/.git ]; then | |
echo "$repo: Is not a repository" | |
continue | |
fi |
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
import os | |
import requests | |
from bs4 import BeautifulSoup | |
url_base = "http://tldp.org/HOWTO/NCURSES-Programming-HOWTO" | |
dir_name = "ncurses_howto" | |
respond = requests.get("http://tldp.org/HOWTO/NCURSES-Programming-HOWTO") | |
if respond.status_code != 200: | |
raise IOError |
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
__kernel void function(__global char *data) | |
{ | |
data[0] = 'H'; | |
data[1] = 'e'; | |
data[2] = 'l'; | |
data[3] = 'l'; | |
data[4] = 'o'; | |
data[5] = '\n'; | |
data[6] = '\0'; | |
} |
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 <cassert> | |
#include <iostream> | |
#include <string> | |
#include <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
static | |
unsigned int compileShader(unsigned int type, const std::string& source) | |
{ | |
unsigned int id = glCreateShader(type); |
NewerOlder