Skip to content

Instantly share code, notes, and snippets.

View rurtubia's full-sized avatar

Randy Urtubia rurtubia

View GitHub Profile
@rurtubia
rurtubia / php_constants.php
Created November 17, 2015 00:24
PHP Constants
<?php
//Declaring a constant.
//Constants do not start with a "$" sign.
//They need to be declared by using the function "define()"
//define() syntax:
#name: name for the constant.
#value: value for the constant.
#case-insensitive: default is false.
@rurtubia
rurtubia / _PHP_list_of_string_functions
Last active November 8, 2015 15:24
PHP String functions
addcslashes() Returns a string with backslashes in front of the specified characters
addslashes() Returns a string with backslashes in front of predefined characters
bin2hex() Converts a string of ASCII characters to hexadecimal values
chop() Removes whitespace or other characters from the right end of a string
chr() Returns a character from a specified ASCII value
chunk_split() Splits a string into a series of smaller parts
convert_cyr_string() Converts a string from one Cyrillic character-set to another
convert_uudecode() Decodes a uuencoded string
convert_uuencode() Encodes a string using the uuencode algorithm
@rurtubia
rurtubia / php_arrays.php
Last active November 8, 2015 13:52
PHP data types
<?php
//An array stores multiple values in one single variable.
//In the following example $cars is an array
$cars = array("Volvo","BMW","Toyota");
//The PHP var_dump() function returns the data type and value:
var_dump($cars);
?>
@rurtubia
rurtubia / daemons_crontab
Created November 6, 2015 00:52
Linux Daemons
cron-crontab
service crond status
opción
servicios
app restart
start
stop
reload
@rurtubia
rurtubia / variable_scope.php
Last active November 5, 2015 22:37
PHP Variables
<!DOCTYPE HTML>
<HTML>
<BODY>
<?php
//GLOBAL VARIABLES are written outside any functions and can only be accessed outside functions
$vg1 = 123;
$vg2 = 456;
echo $vg1 + $vg2;
@rurtubia
rurtubia / case_sensitivity.php
Last active November 6, 2015 00:03
php Hello World
<!DOCTYPE HTML>
<HTML>
<BODY>
<?php
#in php, keywords, classes, functions and user-defined functions are Non-Case Sensitive:
ECHO "hi<br>";
Echo "hi<br>";
echo "hi<br>";
#However, all variables are Case Sensitive:
@rurtubia
rurtubia / ActivityView.xml
Last active August 29, 2015 14:22
MVC Android App
<RelativeLayout>
<TextView
android:id="@+id/tvView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mi TextView"
android:textSize="20sp"/>
android:text=""
<!DOCTYPE html>
<html>
<head>
<title></title>
<!--the script tag links html and javascript.-->
<script type='text/javascript' src='script.js'> </script>
<!--this script links to the jQuery libraries..-->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.js"></script>
<!--CSS reference-->
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
@rurtubia
rurtubia / structure_charts
Created June 3, 2015 16:39
structure_charts
A structure chart is a hierarchy chart
that shows
the data
and control
information flows between the modules.
(Figure 63.1 shows a partial structure chart.)
Each module
is represented as a rectangle.
Each data flow (or data couple)
@rurtubia
rurtubia / font_awesome Cheatsheet.md
Last active October 16, 2015 13:55
Font Awesome