Skip to content

Instantly share code, notes, and snippets.

View lucasscariot's full-sized avatar

Lucas lucasscariot

View GitHub Profile
[{
"username": "mewtwo23",
"message": "ouais et toi ?",
"avatarUrl": "https://cdn.joinbits.video/916e9b69-449c-4d86-b3e3-8314ff388a5e.png",
"createdAt": "2021-11-22 17:59:15.15228"
},
{
"username": "lucky_collect",
"message": "hello mewtwo23, ça va ?",
"avatarUrl": "https://cdn.joinbits.video/38564f1a-46f9-457e-98c2-474c30817f5b.png",
#logging
logoutput: /var/log/sockd.log
#debug: 1
#server address specification
internal: 192.0.2.1 port = 1080
external: eth1
#server identities (not needed on solaris)
#user.privileged: root
@lucasscariot
lucasscariot / index.js
Created February 4, 2018 10:12
Mongoose index models connections like Sequelize Raw
const fs = require('fs')
const path = require('path')
const mongoose = require('mongoose')
const basename = path.basename(module.filename)
const db = {}
mongoose.connect(process.env.MONGODB_URI)
fs
if ! command -v brew $> /dev/null ; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Brew already installed."
fi
function brewInstall() {
if command -v $1 $> /dev/null ; then
echo "$1 Already installed."
return 1
@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

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 / 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'),
@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');

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 / 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
},