Skip to content

Instantly share code, notes, and snippets.

View RoverWire's full-sized avatar

Luis Felipe Perez RoverWire

  • Colima, Mexico
View GitHub Profile
@RoverWire
RoverWire / package.json
Created May 7, 2014 04:32
package.json example
{
"name": "tessel-portal",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "4.0.0",
"jade": "1.3.1",
'use strict';
var request = require('request');
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
@RoverWire
RoverWire / slug_helper.php
Created November 20, 2014 04:37
String to Slug Converter
/**
* URL Slug
*
* Converts an string into a formated url slug string
*
* @access public
* @param string str
* @return string
*/
public function uploadify(){
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$NombreCalculado = calcular_id();
$Extension = strtolower(strrchr ($_FILES['Filedata']['name'],"."));
$Ruta = $this->artesania->CarpetaImagen.$NombreCalculado.$Extension;
if(move_uploaded_file($tempFile,'.'.$Ruta)){
$DatosArchivo = array();
$DatosArchivo['ruta'] = $Ruta;
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Suscripciones de Rover en Google Reader</title>
</head>
<body>
<outline text="Activetuts+" title="Activetuts+" type="rss"
xmlUrl="http://active.tutsplus.com/feed/" htmlUrl="http://active.tutsplus.com"/>
<outline text="ALT1040" title="ALT1040" type="rss"
xmlUrl="http://alt1040.com/feed" htmlUrl="http://alt1040.com"/>
{
"files":
{
"jquery.js": "http://code.jquery.com/jquery.min.js",
"backbone.js": "http://backbonejs.org/backbone-min.js",
"underscore.js": "http://documentcloud.github.com/underscore/underscore-min.js",
"modernizr.js": "http://modernizr.com/downloads/modernizr.js",
"normalize.css": "https://raw.github.com/h5bp/html5-boilerplate/master/css/normalize.css",
"main.css": "https://raw.github.com/h5bp/html5-boilerplate/master/css/main.css",
"spark loader": "http://getsparks.org/static/install/MY_Loader.php.txt",
@RoverWire
RoverWire / class.connection.php
Created March 27, 2012 17:44
Tiny MySQL connection class
<?php
/**
*
*/
class Connection
{
private $result;
private $db = array(
'write' => array(
'host' => 'localhost',
@RoverWire
RoverWire / MY_Model.php
Last active October 9, 2015 04:57
Custom Model Base
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter MY_Model Class
*
* Base model with CRUD functions for CodeIgniter Framework.
* Bassed on Jamie Rumbelow model base class.
*
* @package CodeIgniter
* @subpackage Libraries
@RoverWire
RoverWire / facebook.php
Created January 27, 2016 05:06
This snippet will help you to get your Facebook fan count, in full text. Your page ID can be found at the address http://facebook.com/yourpagename/info.
<?php
$page_id = "302807633129400";
$xml = @simplexml_load_file("http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$page_id."") or die ("a lot");
$fans = $xml->page->fan_count;
echo $fans;
@RoverWire
RoverWire / setup.md
Last active February 17, 2016 23:17
Ubuntu Edge Configuration

Ubuntu + Apache + Nginx (as reverse proxy) + PHP + MariaDB + phpMyAdmin

Before Start

Log in to your ubuntu server as a root user.

Supposing that

  • server ip address is: 1.2.3.4
  • domain my-domain.com