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 / 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 / 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
{

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