Skip to content

Instantly share code, notes, and snippets.

View lucasscariot's full-sized avatar

Lucas lucasscariot

  • Paris, France
View GitHub Profile
@lucasscariot
lucasscariot / slackCommand.js
Last active March 12, 2017 22:09
Slack Command Server
const express = require('express')
const bodyParser = require('body-parser')
let app = express()
app.use(cors())
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
app.post('/', (req, res) => {
@lucasscariot
lucasscariot / extra_parameter.js
Last active November 10, 2017 09:10
How to pass an extra parameter in a Callback function
function foo(extra param) {
tab.some(tabElement => callbackFunction(tabElement, address)) {
console.log(address);
}
}
struct s_flags
{
char flag;
int (*p)(int a, int b);
};
typedef struct s_flags t_flags;
t_flags flags[]= {
{'d', is_d},
{'i', is_i},
@lucasscariot
lucasscariot / create_chained_list.c
Last active September 4, 2016 10:55
Chained List
/* **************************************************************** */
/* Create/Insert chained list */
/* (With Next&Prev) */
/* 1_ Insert in the front */
/* 2_ Insert in the back */
/* */
/* **************************************************************** */
t_list *ft_insert_front(t_list *list, char *content)
{