Skip to content

Instantly share code, notes, and snippets.

View peltho's full-sized avatar

Thomas Pellegatta peltho

  • France
View GitHub Profile
@peltho
peltho / smooth_scroll.js
Created February 4, 2016 17:31
How to smooth scroll to any anchor on the same web page
// Scroll transition to anchor
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
@peltho
peltho / casperjs.php
Created July 12, 2016 12:21
CasperJS Extension UI to Zabbix
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once 'modules/build/ZabbixApi.class.php';
use ZabbixApi\ZabbixApi;
try
{
$dir = "/appli/casperjs_scripts";
@peltho
peltho / dev.yml
Created March 22, 2017 21:54
Environnement de dev Docker (to improve)
version: "3"
services:
web:
image: richarvey/nginx-php-fpm
container_name: webserver_dev
links:
- database
volumes:
- "/chemin/vers/repertoire/local:/var/www/html/"
ports:

Scala


Functions

  • Named functions
def foo(x:Int): Int = x + 1
@peltho
peltho / akka.md
Last active June 9, 2022 12:25
Akka cheatsheet (untyped)
@peltho
peltho / kubernetes.md
Created April 7, 2020 10:18
Kubernetes cheatsheet

Kubernetes

What is it?

It's a system for automating deployment, scaling and management of containerized apps.

Lexique

Word  Meaning 
@peltho
peltho / pass.md
Last active December 16, 2023 13:21
How to setup a pass server

Pass (unix password manager)

Configuration

Server-side
  1. Create a GPG encrypted key: gpg2 --full-gen-key
  2. Export it in a file to share with your guests: gpg2 --export-secret-keys > key.gpg
  3. Retrieve your key with: gpg --list-keys
  4. Init a pass directory: pass init
@peltho
peltho / svelte.md
Last active May 16, 2024 03:44
Svelte cheatsheet
@peltho
peltho / poc.js
Created June 1, 2020 16:24
react native ac3 poc
// index.js
// ...
import { ApolloClient, ApolloProvider, HttpLink, InMemoryCache } from '@apollo/client';
const client = new ApolloClient({
link: new HttpLink({
uri: 'http://192.168.1.47:8090/graphql'
}),
cache: new InMemoryCache()
});
@peltho
peltho / golang.md
Last active May 11, 2024 18:18
Golang cheatsheet

Golang cheatsheet

Variables

var foo int
var foo = 0
foo := 0

var a, b, c int = 1, 2, 3