Skip to content

Instantly share code, notes, and snippets.

View jhonnrodr's full-sized avatar
🏠
Working from home

Jhonn Rodriguez jhonnrodr

🏠
Working from home
  • Remote
View GitHub Profile
@jhonnrodr
jhonnrodr / package.json
Created August 20, 2014 17:04
Package.json Expres
{
"name": "Ejemplo",
"version": "0.0.1",
"dependencies": {
"express": "3.3.5"
}
}
@jhonnrodr
jhonnrodr / app.js
Created August 20, 2014 17:05
Default App.js Node
var express = require('express');
var app = express();
app.set('view engine', 'ejs');
app.use(express.bodyParser());
app.get("/", function(req, res){
res.send("<form action='/envio' method='post'> Nombre: <input type='text' name='name' /> <input type='submit' value'send' /></form> ");
@jhonnrodr
jhonnrodr / ajaxrequest.js
Created August 22, 2014 01:32
$Ajax asynchronous HTTP (Ajax) request
var query = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=76456&format=json"
url = query;
$.getJSON(url, function(data) {
console.log( data );
});
$.ajax({
type: "POST",
url: "/NewEmail",
data: { username: username }
}).done(function(data){
if(data.success == false){
var errores = '';
for(datos in data.errors){
errores += '<small >' + data.errors[datos] + '</small>';
}
try{
$file = Archive::find($id);
if ($file) {
$file->delete();
return Response::json(array(
'success' => true
));
}else{
return Response::json(array(
'success' => false
yum install nano -y; yum update -y; yum upgrade -y; yum install tigervnc-server -y; yum groupinstall "Desktop" -y; yum install firefox -y; rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm; rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux; yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl -y; echo 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf; ' >> /etc/rc.local; echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/vncservers; echo 'VNCSERVERARGS[1]="-geometry 1000x700"' >> /etc/sysconfig/vncservers; vncpasswd; chkconfig vncserver on --level 345; reboot;
$webservice = file_get_contents("http://graph.facebook.com/linc.do");
$json = json_decode($webservice);
var_dump($json->likes);
sudo yum install wget
wget http://chrome.richardlloyd.org.uk/install_chrome.sh
chmod u+x install_chrome.sh
./install_chrome.sh
execute "Please start Google Chrome as a normal user."
Open /opt/google/chrome folder
open google-chrome file or vi google-chrome
exec -a "$0" "$HERE/chrome" "$@"
<img onclick="jQuery('#file').click()" id="imageUpload" src="uploads/images/flyer_picture/{{$fly->detail}}" style="width:200px;height:200px;"/>
<input type="file" id="file" name="pic" style="display: none;"/>
<script>
//-------------------------------------------
//Subir imagen
$("#file").change(function(){
readURL(this);
var inputFileImage = document.getElementById("file");
var file = inputFileImage.files[0];