Skip to content

Instantly share code, notes, and snippets.

View Seif-apprentus's full-sized avatar

Seif Eddine Slimene Seif-apprentus

  • Apprentus
  • Tunis
  • 20:53 (UTC +02:00)
View GitHub Profile
@joulgs
joulgs / terminal.txt
Last active May 6, 2024 14:22
How install libssl1.1 on ubuntu 22.04
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
@AleksandraZuchewicz
AleksandraZuchewicz / detectLanguage.js
Last active June 27, 2023 09:00
Basic Google Cloud Translation API - detectLanguage
const translate = new Translate();
const text = ["这是一个非常好的API", "to jest bardzo dobre API"];
async function detectLanguage() {
let [detections] = await translate.detect(text);
detections = Array.isArray(detections) ? detections : [detections];
console.log("Detections:");
detections.forEach((detection) => {
console.log(detection);
@MikaelCarpenter
MikaelCarpenter / react-select-data-attributes.jsx
Created December 14, 2018 19:09
Solution for adding data attributes to a react-select component by passing in "custom components" where you've manipulated the innerProps prop
import React, { Component } from 'react';
import ReactSelect, { components } from 'react-select';
const TextOption = props => (
components.Option && (
<components.Option { ...props }>
...
</components.Option>
)
);
@miranda-zhang
miranda-zhang / linux.md
Last active May 5, 2024 23:57
Linux Command Cheat Sheet, Ubuntu, CentOS

Linux Command Cheatsheet

Linux Keyboard shortcuts

open terminal: Ctrl+Alt+T

Ctrl + C is used to kill a process with signal SIGINT , in other words it is a polite kill .

Ctrl + Z is used to suspend a process by sending it the signal SIGTSTP , which is like a sleep signal, that can be undone and the process can be resumed again.

@anmolnagpal
anmolnagpal / pm2.txt
Created July 11, 2017 07:10
Pm2 CheatSheet
Usage
Hello world:
$ pm2 start app.js
Raw Examples
# Fork mode
$ pm2 start app.js --name my-api # Name process
@mircobabini
mircobabini / lib.markerclusterer-2.1.2.js
Last active November 17, 2023 13:35
MarkerClustererPlus for Google Maps V3 / v2.1.2
/**
* @name MarkerClustererPlus for Google Maps V3
* @version 2.1.2 [May 28, 2014]
* @author Gary Little
* @fileoverview
* The library creates and manages per-zoom-level clusters for large amounts of markers.
* <p>
* This is an enhanced V3 implementation of the
* <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/"
* >V2 MarkerClusterer</a> by Xiaoxi Wu. It is based on the
@dmozzy
dmozzy / CalcDistance.js
Created April 16, 2012 13:00
Calculate Distance using google.maps.geometry.spherical.computeDistanceBetween
<script src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry" type="text/javascript"></script>
<script type="text/javascript">
function calcDistance (fromLat, fromLng, toLat, toLng) {
return google.maps.geometry.spherical.computeDistanceBetween(
new google.maps.LatLng(fromLat, fromLng), new google.maps.LatLng(toLat, toLng));
}
</script>