Skip to content

Instantly share code, notes, and snippets.

Avatar
🐉
playing with Ghidra

Yann Defretin kinoute

🐉
playing with Ghidra
View GitHub Profile
@kinoute
kinoute / style.css
Created Apr 21, 2021
Add a wrapper around tables to allow overflow on Jekyll websites
View style.css
.table-wrapper {
overflow: auto;
padding-top: 10px;
padding-bottom: 10px;
}
@kinoute
kinoute / syntax-highlighting-languages.md
Created Jun 21, 2020
A list of code blocks from many languages to, for example, test a custom theme and see how it renders the code for each language.
View syntax-highlighting-languages.md

Syntax Highlighting in Markdown

A list of code blocks from many languages to, for example, test a custom theme and see how it renders the code for each language.

Bash

#!/bin/bash
@kinoute
kinoute / helpers.c
Created Jun 10, 2020
Harvard CS50 filters
View helpers.c
#include "helpers.h"
#include <stdio.h>
#include <math.h>
// Convert image to grayscale
void grayscale(int height, int width, RGBTRIPLE image[height][width])
{
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
@kinoute
kinoute / plurality.c
Created Jun 9, 2020
Harvard CS50 Plurality
View plurality.c
#include <cs50.h>
#include <stdio.h>
#include <string.h>
// Max number of candidates
#define MAX 9
// Candidates have name and vote count
typedef struct
{
@kinoute
kinoute / substitution.c
Last active Jun 11, 2020
Harvard CS50 substitution
View substitution.c
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, string argv[])
{
// the user must provide one and only argument
if (argc != 2)
{
View .editorconfig
# EditorConfig is awesome: http://EditorConfig.org
# https://github.com/jokeyrhyme/standard-editorconfig
# top-most EditorConfig file
root = true
# defaults
[*]
charset = utf-8
@kinoute
kinoute / .Dockerfile
Last active Jan 3, 2022
Example of Ruby on Rails 6 Multi-stage builds with Docker. Development/production environments share the same Dockerfile.
View .Dockerfile
FROM ruby:2.7.1-slim AS base
LABEL maintainer="Yann Defretin <yann@defret.in"
# Common dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
--no-install-recommends \
build-essential=12.6 \
gnupg2=2.2.12-1+deb10u1 \
View get-bedtime-stories-scrapper.py
import requests
from bs4 import BeautifulSoup
import time
import pandas as pd
import random
from urllib.parse import urlsplit
stories_cols = ['title', 'story']
csv_stories = pd.DataFrame(columns=stories_cols)
@kinoute
kinoute / get-md-images.sh
Last active May 11, 2020
Download remote images from markdown/jupyter notebooks files and update paths from remote to local.
View get-md-images.sh
#!/bin/bash
###################################################################
# Script Name : get-md-images.sh
# Description : Download all remote images written as markdown
# in our files and replace URLs by local path.
# Author : Yann Defretin
# Email : yann@defret.in
###################################################################
@kinoute
kinoute / push-to-github-gitlab.sh
Last active Aug 16, 2019
Push to remote Github and Gitlab at the same time
View push-to-github-gitlab.sh
# https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem
git remote set-url --add --push origin git@github.com:Foo/bar.git
git remote set-url --add --push origin git@gitlab.com:Foo/bar.git