Skip to content

Instantly share code, notes, and snippets.

View norfair00's full-sized avatar
🏠
Working from home

Nicolas Favre norfair00

🏠
Working from home
View GitHub Profile
@norfair00
norfair00 / distribution.json
Last active June 29, 2019 03:29
Indium Launcher
{
"version": "1.0.1",
"discord": {
"clientId": "385581240906022916",
"smallImageText": "WesterosCraft",
"smallImageKey": "seal-circle"
},
"java": {
"oracle": "http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html"
},
@norfair00
norfair00 / database.yml
Created June 27, 2019 22:41
Docker stack
version: '2'
services:
mysql:
image: mysql
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- 127.0.0.1:3306:3306
environment:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@norfair00
norfair00 / generate.js
Created March 21, 2019 23:45 — forked from dehamzah/generate.js
Generate secret key in NodeJS
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); });
@norfair00
norfair00 / routes.js
Created July 23, 2018 20:26
routes configuration example
modules.export = functtion () {
}
/**
* Path: url of route
* Controller: function of router
* Rules: for manage acccess to ressource
*
* Example: addRoute("/admin", adminRouter, checkLoggerAndAsRoles)
@norfair00
norfair00 / slugify.js
Created November 19, 2017 22:55 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@norfair00
norfair00 / slug.js
Created November 19, 2017 22:55 — forked from bentruyman/slug.js
JavaScript Slug Generator
// Generates a URL-friendly "slug" from a provided string.
// For example: "This Is Great!!!" transforms into "this-is-great"
function generateSlug (value) {
// 1) convert to lowercase
// 2) remove dashes and pluses
// 3) replace spaces with dashes
// 4) remove everything but alphanumeric characters and dashes
return value.toLowerCase().replace(/-+/g, '').replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '');
};
@norfair00
norfair00 / steamid_conversion.php
Created May 3, 2016 15:27 — forked from almirsarajcic/steamid_conversion.php
The function used to convert 64bit Steam ID to 32bit and the other way around.
<?php
function convert_id($id)
{
if (strlen($id) === 17)
{
$converted = substr($id, 3) - 61197960265728;
}
else
{
@norfair00
norfair00 / gist:edab684c0f4bd9c63372
Created August 31, 2015 22:00
sudo apt-get install libappindicator1
sudo apt-get install libappindicator1
--[[---------------------------------------------------------------------------
English (example) language file
---------------------------------------------------------------------------
This is the english language file. The things on the left side of the equals sign are the things you should leave alone
The parts between the quotes are the parts you should translate. You can also copy this file and create a new language.
= Warning =
Sometimes when DarkRP is updated, new phrases are added.
If you don't translate these phrases to your language, it will use the English sentence.