Skip to content

Instantly share code, notes, and snippets.

View lucasscariot's full-sized avatar

Lucas lucasscariot

View GitHub Profile
@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)
{
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 / 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);
}
}
@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 / model-user.js
Last active June 22, 2023 17:08
Composite Primary Key in Sequelize
/*
* Migration
*/
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
firstName: {
type: Sequelize.STRING
},

Keybase proof

I hereby claim:

  • I am lucasscariot on github.
  • I am lucasscariot (https://keybase.io/lucasscariot) on keybase.
  • I have a public key ASB4IglRJ2dZ1LYgSsIkgRS6hQdRivflUbJMFsU5cPJdTwo

To claim this, I am signing this object:

@lucasscariot
lucasscariot / bugsnag.js
Created June 19, 2017 09:35
Bugsnag and emberjs
'use strict';
import Ember from 'ember';
import config from '../config/environment';
export default {
name: 'bugsnag',
initialize: function(appInstance) {
const appController = appInstance.lookup('controller:application');
@lucasscariot
lucasscariot / component.js
Last active July 17, 2017 09:08
Forest - Conversation Smart View
'use strict';
import Ember from 'ember';
import SmartViewMixin from 'client/mixins/smart-view-mixin';
export default Ember.Component.extend(SmartViewMixin.default, {
conversations: function () {
this.set('currentConversation', this.get('records.firstObject'));
this.set('currentConversation', this.get('records.firstObject'));
return this.get('records');
}.property('records'),
set encoding=utf-8
set number
set ruler
syntax on
set smartindent
set autoindent
set cindent
set mouse=a
set t_Co=256
set autoread
@lucasscariot
lucasscariot / psql.md
Last active December 6, 2017 10:27
Cheat sheet for Postgresql command line.

Output Formating

Command Info
\a Toggle aligned/unaligned rows (default aligned)
\x Toggle expanded output (default off)
\H Toggle html output (default off)
\t Show only rows (default off)

Database Navigation