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
@codebrainz
codebrainz / c99.l
Created June 14, 2012 23:49
C99 Lex/Flex & YACC/Bison Grammars
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E ([Ee][+-]?{D}+)
P ([Pp][+-]?{D}+)
FS (f|F|l|L)
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U))
%{
#include <stdio.h>
@bwhite
bwhite / rank_metrics.py
Created September 15, 2012 03:23
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@joyrexus
joyrexus / demo.txt
Last active October 19, 2018 22:25
Demonstrate how to extract and run code blocks from *.lang.md* files.
% marko.coffee -x try.python.md > try.py
% python try.py
hello world!
yes!
% marko.coffee -x try.python.md | python -s
hello world!
yes!
LD_LIBRARY_PATH=../lib64/ ./glc-capture --start -v 3 --disable-audio --uncompressed=1M -z none -o /dev/stdout -l /dev/stderr etracer | LD_LIBRARY_PATH=../lib64/ ./glc-play /dev/stdin -t -v 3 -y 1 --uncompressed=1M -o /dev/stdout | ffmpeg -i /dev/stdin -f yuv4mpegpipe -pix_fmt yuv420p -vcodec libx264 -vprofile baseline -preset ultrafast -tune zerolatency -x264opts "intra-refresh:vbv-maxrate=5000:vbv-bufsize=200:slice-max-size=1500:sliced-threads" -threads auto -f yuv4mpegpipe -o /dev/stdout | ../../scripts/video/example
gcc -g -std=gnu99 -Wall -I/usr/include -L/usr/lib -L/usr/lib/x86_64-linux-gnu/ test.c aveasy.c -lglut -lGL -lGLU -lGLEW -lglfw `pkg-config --cflags --libs libavcodec libavformat libavdevice libswscale` -o example
@pascalmaddin
pascalmaddin / parallax-image-with-text.html
Last active May 14, 2021 14:38
An Image with parallax-effect and with some text, which is fading out while scrolling
<div id="banner">
<div class="wrap-center">
<div class="banner-centered" id="banner-text">
<h2>Hello <strong>We Are Company-Name</strong>, Glad To See You. :-)</h2>
</div>
</div>
</div>
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@toroidal-code
toroidal-code / pacat.c
Created February 4, 2014 05:54
PulseAudio example with callbacks
/***
This file is part of PulseAudio.
Copyright 2004-2006 Lennart Poettering
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
@nitely
nitely / emoji.py
Created February 5, 2014 20:28
Emojis for python-Markdown
#-*- coding: utf-8 -*-
# Tested on Markdown 2.3.1
#
# Copyright (c) 2014, Esteban Castro Borsani
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@BukhariH
BukhariH / gist:9125653
Last active March 11, 2019 18:31 — forked from zobar/gist:1499822
How to run a bot on Heroku
  1. Add Heroku to your Gemfile and bundle install.
  2. Create your Heroku app. This will only work with their (currently-beta) 'cedar' stack, so you have to heroku create --stack=cedar.
  3. Create a Procfile for your bot. This tells Heroku how to run your worker. In our case, the bot is bot.rb, so the only line in the Procfile is cinch: bundle exec ./bot.rb
  4. Commit and push to Heroku.
  5. You do not want a Web worker running, so heroku scale web=0 cinch=1. This also sets up your deployments to restart the bot.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>