Skip to content

Instantly share code, notes, and snippets.

View RomainLanz's full-sized avatar

Romain Lanz RomainLanz

View GitHub Profile
@thetutlage
thetutlage / context.ts
Last active April 19, 2024 14:50
Unploy Server API Abstraction for AdonisJS
import Up from './index'
declare module '@ioc:Adonis/Core/HttpContext' {
interface HttpContextContract {
up: Up
}
}
@reinink
reinink / query.sql
Last active November 14, 2023 11:08
Text search across multiple tables using MySQL
select
first_name,
last_name
from
users
left join
companies on companies.id = users.company_id
where (
companies.name like 'TERM%' or
first_name like 'TERM%' or
@RomainLanz
RomainLanz / .vimrc
Last active November 11, 2019 18:15
set nocompatible " Use VIM settings instead of Vi.
syntax enable " Enable syntax highlighting.
so ~/.vim/plugins.vim " Load all plugins.
"-------------Misc-------------"
set backspace=indent,eol,start " Make backspace behave like every other editor.
set tw=0 " Disable automatic linebreak.
set noerrorbells visualbell t_vb= " No damn bells!
set autowriteall " Automatically write the file when switching buffer.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Font
:set guifont=Source\ Code\ Pro:h14
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason?
:set laststatus=0
:set noshowmode "don't show --INSERT--
:set noruler "don't show line numbers/column/% junk
@hyamamoto
hyamamoto / string.hashcode.js
Created September 30, 2016 07:19
JavaScript Implementation of String.hashCode() .
/**
* Returns a hash code for a string.
* (Compatible to Java's String.hashCode())
*
* The hash code for a string object is computed as
* s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
* using number arithmetic, where s[i] is the i th character
* of the given string, n is the length of the string,
* and ^ indicates exponentiation.
* (The hash value of the empty string is zero.)
@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing