Skip to content

Instantly share code, notes, and snippets.

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

Fran Perez bran921007

🏠
Working from home
View GitHub Profile
@bran921007
bran921007 / post ajax
Last active December 14, 2015 00:06 — forked from jhonnrodr/post ajax
Post Ajax Jquery
$.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>';
}
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;
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 );
});
public function index()
{
$client = new Client();
// Login page
$crawler = $client->request('GET', 'https://email.linc.do/iredadmin/login');
$form = $crawler->selectButton('Login')->form();
$crawler = $client->submit($form, array('username' => 'postmaster@linc.do', 'password' => '*****'));
<VirtualHost *:80>
DocumentRoot /var/www/linc/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
<proxy *>
Order deny,allow
Allow from all
</proxy>
ProxyPreserveHost On
<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];
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" "$@"
<?php
/* connect to gmail */
$hostname = '{email.linc.do:993/imap/ssl/novalidate-cert}INBOX';
$username = 'kamel@linc.do';
$password = '593musica';
/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Linc: ' . imap_last_error());
/* grab emails */
curl -s https://getcomposer.org/installer | php -- --quiet --install-dir=$OPENSHIFT_DATA_DIR
php $OPENSHIFT_DATA_DIR/composer.phar update
ln -s public php
<?php
/*
PHP Library - Social Security Number-related functions
Copyright (c) 2009, reusablecode.blogspot.com; some rights reserved.
This work is licensed under the Creative Commons Attribution License. To view
a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
94305, USA.