Skip to content

Instantly share code, notes, and snippets.

View ricardoalcocer's full-sized avatar
💭
making music at https://alcomusic.com

Alco ricardoalcocer

💭
making music at https://alcomusic.com
View GitHub Profile

RSA KEYS

If you haven't already got a ~/.ssh/id_rsa.pub on your computer, you'll need to generate one.

To generate key

ssh-keygen

To copy ssh key to your clipboard on a mac:

@ricardoalcocer
ricardoalcocer / short-number-format.php
Created August 11, 2020 18:03 — forked from RadGH/short-number-format.php
Short Number Formatter for PHP (1000 to 1k; 1m; 1b; 1t)
<?php
// Converts a number into a short version, eg: 1000 -> 1k
// Based on: http://stackoverflow.com/a/4371114
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {
@ricardoalcocer
ricardoalcocer / htmlentity.js
Created May 25, 2017 19:36 — forked from CatTail/htmlentity.js
Javascript: encode(decode) html text into html entity
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
@ricardoalcocer
ricardoalcocer / html5-video-streamer.js
Created July 23, 2016 02:01 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@ricardoalcocer
ricardoalcocer / index.js
Created June 20, 2014 20:04 — forked from adampax/index.js
Cross-platform Facebook and Twitter social sharing
//must have TiSocial module installed for iOS: https://github.com/viezel/TiSocial.Framework
//share() Android -- uses intent, iOS --- uses TiSocial share dialog
//tweet iOS Only -- uses TiSocial tweet dialog
function onClickShare(){
require('socialmod').share({
text: 'text to share',
title: 'Title',
url: 'http://example.com'
//
// blog.clearlyionnovative.com
// twitter: @aaronksaunders
//
// Model file for integration Appcelerator Titanium Alloy with Wordpress JSON Plugin
//
exports.definition = {
config : {
"columns" : {},