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

SSL upgrades on rubygems.org and RubyInstaller versions

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


Hello,

If you reached this page, means you've hit this SSL error when trying to

@norfair00
norfair00 / main.sh
Last active November 17, 2015 22:18
VPS Install
apt-get update
apt-get install build-essential
apt-get install python
apt-get install git
apt-get install curl
#wget --no-check-certificate --output-document=Python.tgz https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
#tar xfz Python.tgz
#cd Python-3.4.3
--[[---------------------------------------------------------------------------
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.
@norfair00
norfair00 / gist:edab684c0f4bd9c63372
Created August 31, 2015 22:00
sudo apt-get install libappindicator1
sudo apt-get install libappindicator1
@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 / 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 / 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 / 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 / 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); });
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.