Skip to content

Instantly share code, notes, and snippets.

View fennecdjay's full-sized avatar
🎵
Star Gwion, You'll make my day

Jérémie Astor fennecdjay

🎵
Star Gwion, You'll make my day
  • France
View GitHub Profile
@jhburns
jhburns / razz_lang.hs
Last active April 29, 2024 18:48
Small RPN calculator
-- razz_lang
import Data.Function
import Data.Semigroup
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Text.Read as Read
-- Stack types
@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active May 18, 2024 14:10
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m

\u001b is the unicode escape for ESCAPE/ESC, meant to be used in the source of your bot (see ). If you wish to send colored text without using your bot you need to copy the character from the website.

@harieamjari
harieamjari / kpa.c
Last active October 2, 2023 03:10
An implementation of Karplus-Strong Algorithm in C. Using /dev/urandom in linux.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#define SECONDS 6 /* you can change this to suit for your preferences */
#define LENGTH 300 /* you can experiment with different string length */
char wav_struct[] = {
'R', 'I', 'F', 'F',
@daoleno
daoleno / reload-browser.sh
Created November 12, 2019 06:31
reload-browser - A cross-platform wrapper for reloading the current
#!/bin/sh
# reload-browser - A cross-platform wrapper for reloading the current
# browser tab
# Eric Radman, 2014
# http://eradman.com/entrproject/scripts/
usage() {
case `uname` in
Darwin)
# applescript needs the exact title
@fnky
fnky / ANSI.md
Last active May 24, 2024 13:38
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@arslancharyev31
arslancharyev31 / C_v1.bnf
Created October 14, 2017 15:32
C .bnf grammar. Version 1.
{
tokens=[
space='regexp:\s+'
identifier='regexp:[a-zA-Z][a-zA-Z0-9_]*'
integer-constant='regexp:\d+'
character-constant='regexp:[a-zA-Z]'
floating-constant='regexp:[+-]?([0-9]*[.])?[0-9]+f'
enumeration-constant='regexp:[a-zA-Z][a-zA-Z0-9_]*' // Same as identifier
]
@fm4dd
fm4dd / gcc compiler optimization for arm systems.md
Last active April 9, 2024 19:24
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@fennecdjay
fennecdjay / soundpipe.h
Last active February 7, 2017 00:11
use this to compile ff2spa without soundpipe
#ifndef SPFLOAT
#define SPFLOAT double
#endif
@rubo77
rubo77 / create-gist.sh
Last active August 30, 2020 09:41 — forked from s-leroux/pgist.sh
A utility to create a gists from command line - for support, please check the repo https://github.com/ceremcem/create-gist
#!/bin/bash
GITHUB_USERNAME=rubo77
if [ "$1" == "" ]; then
echo 'usage: gistfile-post.sh filename [gistname]'
exit 0
fi
# 0. file name for the Gist
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active May 21, 2024 15:55
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings