Current Topic: internet

Posted by Michael Alfaro on April 29, 2013

JSCompress.com – An online Javascript compression tool

JSCompress

This site has been in my toolbox for quite a while now and still comes in handy when I can’t automate the compression of JS files.  You can either copy and paste the JS or upload the whole file and get back the minified JS.  It’s amazing to be able to reduce a file’s size by 70% to 80% and still have it work as intended.

If you need reasons for minifying a JS file, here you go:

  • Comments and whitespace are not needed for javascript execution, thus removing them will speed up execution times.
  • Faster download times by reducing the size of the JS files
  • Reduced bandwidth usage
  • Reduced number of HTTP requests on your server by combining many javascript files into one compressed file
  • It’s the right thing to do!

http://www.jscompress.com/

 


Topics: , , ,

Posted by Michael Alfaro on April 15, 2013

htaccesstools.com, a great source for all your htaccess needs

http://www.htaccesstools.com/

Wanted to share one of the websites I end up using a lot due to my inability to remember every htaccess command from memory.  here’s a list of the commands documented there:

Detect and redirect iPhone
How to create a password for a .htpasswd file using PHP
How to find the full path to a file using PHP
Htaccess redirect
htpasswd – The file to store passwords
Prevent hotlinking
Redirection
Password Protection with htaccess

Hope you find it as useful as I do!

Htaccesstoolscom


Topics: , , ,

Posted by Michael Alfaro on April 7, 2013

Office 365, enable/disable the junk email filtering for all users within your organization

Found one of our employees junk filtering wasn’t working and had to open up a ticket with the Microsoft Office 365 support team (great customer service btw), and they helped me figure out where the filtering was turned off. Below is a way to do it through powershell for the whole company.

  1. Click Start > All Programs > Accessories > Windows PowerShell > Windows PowerShell.
  2. Run the following command:
    $LiveCred = Get-Credential
  3. Run the following command:
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
  4. Run the following command:
    Import-PSSession $Session
  5. Run the following command:
    Get-mailboxJunkEmailConfiguration

    ( this command can be used to see if the Junk filtering is enabled or not)

  6. To turn ON the Junk email filtering your organization :

    Get-Mailbox | Set-MailboxJunkEmailConfiguration –Enabled $True

Topics: , , ,

Posted by Brandon Romano on March 16, 2013

Executing MySQL Queries in PHP

Rphp-mysqlecently I’ve been doing a lot of web programming and it was only a matter of time before I needed to use a MySQL database.  I found this really useful tool for PHP called Mysqli.  There’s a whole lot on the advanced use for Mysqli on the link I just provided, but I’m going to give you a quick example that you will be able to follow for a good majority of your queries.

$mysqli = getDatabase();

//call performResultQuery() and performUpdateQuery() here..

$mysqli->close();

//========= Functions ============

//For getting data from database
function performResultQuery($resultQuery){
    global $mysqli;

    //You might want to return result if you're
    //Performing multiple queries
    $result = $mysqli->query($resultQuery);

    $row = $result->fetch_row();
    $firstVal = $row[0]; //Grabs first column in row 
    $secondVal = $row[1]; //Grabs the second column in row
    //etc...
}

//For updating data in database
function performUpdateQuery($updateQuery){
    global $mysqli;
    $mysqli->query($updateQuery);
}

//Return the database, fill in DB_HOST, DB_USER
//USER_PASS, and DB_NAME
function getDatabase(){
    $DB_HOST = '';
    $DB_USER = '';
    $USER_PASS = '';
    $DB_NAME = '';
    $DB_CONNECTION = new mysqli($DB_HOST, $DB_USER, $USER_PASS, $DB_NAME);

    // Checking connection
    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }

    return $DB_CONNECTION;
}

Mysqli has been the only MySQL connection I’ve used in PHP, but am so pleased with it I find no need to search for an alternative.


Topics: , ,

Posted by Michael Alfaro on March 11, 2013

20 Things I learned about the Web

Ran into this after cleaning out my email that was sent to me by a colleague of mine.

http://www.20thingsilearned.com/

This is a really great resource for anyone who might be interested in learning the more technical aspects of the web and browsers.  This is browser-based book (built in CSS3) that explains the internet, the web, browsers, and more in extremely simple to understand language.  Its a great resource for anyone who might be less technical and still wants to understand the more technical aspects of how the web works.

Here’s the link to book in PDF format:
20ThingsILearnedaboutBrowsersandtheWeb

Enjoy, it’s a great read!

20 Things I learned about the web

 


Topics: ,

Posted by Michael Alfaro on March 4, 2013

How to disable auto correction in MobileSafari/UIWebView

Stackoverflow
Working on a project in phonegap and had to figure out how to stop the auto correct feature of IOS from affecting certain types of HTML input fields that really didn’t need auto-correction such as “First Name”.

Stackoverflow came through again in this post: http://stackoverflow.com/questions/6461101/how-can-i-prevent-keyboard-autocompletion-in-mobilesafari-uiwebview
All I had to do is put autocorrect=”off” in the element to stop the auto correct.  Thanks to Patrick for finding this!

<input type="text" id="your-field" autocorrect="off" />

Topics: , , , ,

Posted by Michael Alfaro on February 26, 2013

Marching Cubes Algorithm

I am currently working on a project that involves the dynamic creation of platforms and surfaces, so I have been researching various ways to create meshes during Unity’s run-time and came across this.

polygonise4

The algorithm known as Marching Squares (2D) or Marching Cubes (3D) is capable of rendering isosurfaces in real time with speed and efficiency due to it being based on look-up tables of pre-determined values. The clarity and accuracy of this rendering is based on how many “cubes” are used to render the object.

polygonise3

 

The link above is a good read and is my primary source for my Unity implementation of the algorithm. I will update with more on this once I have a working example.


Topics: , ,

Posted by Lauren Ryan on February 19, 2013

OAuth 2.0 Vulnerabilities

When I first began researching OAuth 2.0, I came across this post by Eran Hammer. Hammer was one of the lead authors and editors of the protocol, yet ended up withdrawing oauth-2-smhis name from the specification and denouncing the entire thing. He listed off many of his issues with OAuth2, one of which being major security failures. I kind of brushed it off at the time, due to the fact that both Google and Facebook supported their own versions of OAuth2. I figured if two behemoths like those supported the protocol, it couldn’t be that bad.

Today, I read this blog post by Egor Homakov which describes an exploit of Facebook using OAuth2 and Chrome. Using it, any client’s access token can be obtained and thus their accounts can be stolen. It’s crazy how vulnerable the web can be. The post references Eran Hammer’s blog post at the end, and I went back and read Hammer’s post with new eyes. Makes you wonder what vulnerability will be exposed next!


Topics: , , , ,

Posted by Michael Alfaro on February 18, 2013

Transparent Smartphones Are Almost Here!

The Taiwanese company Polytron Technologies has unveiled a trasparent cellphone prototype that has just made the idea of a see-through cellphone a bit more believable.

article-2279914-17A10D52000005DC-494_638x405

The prototype’s only visible features are the SD card slot, speakers, batteries, and almost-invisible circuitry. The glass that comprises the main screen is a fully functional LED display. All it seems to be missing so far is a bootable operating system and touchscreen functionality, which the producers hope to have implemented by the end of the year.

 

Transparent smartphones open up an entire realm of possibilities for UI design choices and  design of apps. For example, a camera application could do away with the need to render what the camera lens is currently viewing on the screen with some clever calibration. While this in itself is cool, it could lead also lead to some awesome application (and even widgets for Android) concepts that involve a persistently running camera lens allowed by the reduced consumption of battery power, such as Google Glasses-esque app!


Topics: ,

Posted by Michael Alfaro on February 17, 2013

Microsoft Safety Scanner – Emergency Antivirus through your browser

Doctors, Lawyers, me…. what do we all have in common?  We all work in professions that tend to be called upon by family and friends for advice about their problems.  In my case, I’m not being asked about a rash or suing someone, but rather “why is my computer so slow”.

So I wanted to share a tool of the trade that has come in handy over the years.  It’s the Microsoft Safety Scanner, a downloadable antivirus tool that runs right from your browser.  It works great on an infected machine if you’re able to get to it from the browser without the virus getting in the way.
http://www.microsoft.com/security/scanner/en-us/default.aspx

Capture

I’ve used this for a lot of machines with broken/expire or even no antivirus installed.  It’s really great when all the local tools fail to get rid of the infected files.  After getting the computer cleaned up, I tend to install the free Microsoft Security Essentials.
http://windows.microsoft.com/en-US/windows/security-essentials-download

It’s free, lightweight, auto updates and stays out of the way.  Pretty much everything you’re looking for in an antivirus tool.

Enjoy and hopefully you’ll be able to share these tools with someone you know :)


Topics: , ,