Videos uploaded by user “optikalefx”
SSD - Replace Macbook Pro Optical Drive with OCZ Vertex 2
Watch as we take out my optical drive and replace it with an SSD. This OCZ Drive gets a theoretical 285MB/s Read and 275MB/s Write. Compared to my current SSD that ships with apple at 70MB/s read and 50MB/s write. yea.. BIG speed difference. Google optibay for the optical drive enclosure
Views: 27839 optikalefx
MongoDB Complex Queries Explained
We take this pet project called Sprout, and some plant hardiness zone data, and we run some queries on it. Using this we are able to find out what plants to plant in your area depending on the month. We also look at this code in NodeJS.
Views: 29848 optikalefx
In most spread sheet applications like excel or google docs, you have the ability to SUM only certain rows in a column IF they meet certain criteria. Well with a mysql database, it's like a complicated spreadsheet, so we should be able to do the same thing. Here we learn how to combine a mysql SUM function with a mysql IF statement to achieve this.
Views: 6995 optikalefx
How to make a public JSON API
using PHP we can make our own API then we can use that api with jquery and JSONP NOTE!!!! - usually API's have some kind of authentication, so do that. That way you know who is using your API.
Views: 67550 optikalefx
mySQL Find Duplicates
How often do you have to get into someones database and fix stuff? And the problem is because they didn't unique key something, and now you have a ton of duplicates. Super annoying right? Well with this little bit of sql you can find all the duplicates and then deal with them. So get rid of them and then unique that field.
Views: 6366 optikalefx
Floating and Clearing with CSS - fixing all those problems
When you float elements you need to clear afterwards so you can add content after. HOWEVER if you just set the parent to overflow:auto, it fixes everything
Views: 22590 optikalefx
jQuery Autofill / Complete with Tagging
Tagging and autofill are super useful input methods for sites. Here we make both plugins, and combine them together. Ok we don't make them in the video, but I show you how to use them. Both sources are here https://github.com/optikalefx/OpenJS-Autofill https://github.com/optikalefx/OpenJS-Tags
Views: 15274 optikalefx
Javascript Reduce and Map In Depth. Explained.
Everyone knows about Array.forEach, but Array.forEach is just an abstraction for Array.reduce, the core of the Array methods. Let's dive in.
Views: 18855 optikalefx
Using Text Wrangler - Advanced part 1
changing and setting language setting font style show invisibles (cmd z and shift cmd z) show line numbers showing what line your on soft wrap vs hard wrap creating custom keyboard shortcut for comments split code view function jumping using markers how to tab and detab (cmd bracket) moving between documents (cmd opt bracket) find find next (cmd g) quick find (cmd opt f)
Views: 50973 optikalefx
Regex Phone Number - Step by Step
This is the basics of a phone number regex to just help you understand how to write regex in general VIDEO CORRECTION!! The end of the regex needs to be a $ not a ? ^\+?\d.\s? // +1 or +44 \(?\d{3}\)? // first part [-.\s]? // possible spacing / sep \d{3} // 2nd part [-.\s]? // possible spacing / sep \d{4}? // 3rd part
Views: 18715 optikalefx
preload images with jquery
Views: 6975 optikalefx
htaccess not working? Not being read? Fix!
By changing a few permissions and adding the rewrite module we can make sure htaccess is working
Views: 7672 optikalefx
jQuery Find vs. FIlter
Learn the difference between find and filter in jquery. find - looks for a match in the children filter - looks for a match in the current selection
Views: 3291 optikalefx
Web Scraping with Puppeteer, NodeJS & Shopify
I really love Google's Puppeteer. It's a great utility for PDF generation, screenshots and web scraping. Today we look at how to scrape some public shopify data using Puppeteer. We need to put together a lot of the async-await things from the last few videos.
Views: 6980 optikalefx
CSS Image Gallery Corner Checkbox Effect
Yea, I really don't know what to call this one. Just a cool effect I found on cloudapp. Have fun watching me write CSS. woo.
Views: 3823 optikalefx
jQuery FancyBox - Vimeo Popout videos
using the fancybox iframe technique we can use the vimeo and youtube iframe embed codes to get that lightbox pop out effect
Views: 24101 optikalefx
Super Simple AJAX File Upload
Seriously, it doesn't get more simple than this. I made a jQuery plugin that uses XHR2 and jQuery (of course) to upload files with ajax. Gist of the plugin is here https://gist.github.com/4504947
Views: 49290 optikalefx
Javascript Parallax Effect Explained
PART 2 HERE http://www.youtube.com/watch?v=O39OEPC20GM We go through some raw ins and outs of doing the famed parallax effect. It seems to be a big deal lately. This is by NO means the only way to do this, but this is the one I like. I use webkit transform instead of margin-top because of performance. To make this work in all browsers, you need to use all the css3 transforms, and the paul irish request animation polyfill, as well as make a fallback from the transforms to margin-top.
Views: 49618 optikalefx
Paypal Adaptive Payments - Parallel Payments JSON Part 1
Adaptive payments is a FREE api that allows you as the developer to pay multiple people at once. We go over how to create this request in PHP, including setting item details about the order. Please see part 2 for the continuation of this tutorial. Note!!!! in the video we extend app, just get rid of that. I only did that for my own setup.
Views: 20721 optikalefx
More TextWrangler Regex
Views: 7609 optikalefx
Air Drone helicopter using iPad
So if anyone wonders what I do for a job. This is part of it. We got 2 free airdrones from parrot, and got to play with them today. They are REALLY fun to play with. But they only last 15 to 20 minutes. Idk if its worth $300, but hey, if you have a REALLY responsible kid, or can handle it, its a great gift
Views: 138455 optikalefx
Regex Validating Email in Javascript - Explained
Ill explain to you how to write a regex for checking for a valid email, but with explanation to each part. The final regex is [a-zA-Z0-9_\.-][email protected][a-zA-Z0-9-]+\.[a-zA-Z0-9\.]{2,5}$
Views: 5585 optikalefx
Super Efficient Programming Workflow on Mac (Git + Coda)
This is my basic workflow for working on projects Code in Coda Source control with Tower and Total Terminal Database with Sequel Pro FTP with Transmit Files with DropBox Testing with Chrome
Views: 14026 optikalefx
Restore iPhone and jailbreak it
My iPhone was running horribly slow, mostly due to the fact that I've installed so much crap on it, jailbroken and legit. So I thought I would restore it, and then re-jailbreak it. I need to jailbreak it because I depend on apps like cycorder and pdanet. Pdanet allows me to tether my iPhone to my mac and have internet wherever I go. So I got a new mic in this video, my voice should sound a lot clearer. And there are no transitions in this video, while I have the capability to add transitions, I want to keep it very short, and that means no fluff. Plus it keeps you interested through the whole process. I kept zooming around to avoid showing my phone number, so sorry if that is annoying. I couldn't show the iPhone because my iSight is broken from the last time I took my macbook apart and replaced the hard drive. I will be opening it up to fix the usb inside, so Ill make a video when the time comes.
Views: 36210 optikalefx
PHP Read a Directory and Write a File
learn how to read a directory with PHP and then create a text file out of which you read.
Views: 12698 optikalefx
Photogaphy White Background with Aperture Luminance Curves
Using Luminance curves, digital color meter, and some photoshop we can make this image of a monitor look a hell of a lot better. White isn't so hard when you have curves.
Views: 2588 optikalefx
SEO friendly URLs
Have a bunch of URLs that are all index.php?pageid=23423&whater=asdfasd&somethig=asdf? And you want to change it to www.site.com/clean? htaccess is how
Views: 17565 optikalefx
mySQL Triggers  - How To
mysql triggers are little programs that run before or after a sql call to then do something else behind the scenes.
Views: 47961 optikalefx
Multiple Email Attachments with PHP
https://gist.github.com/optikalefx/5149537 This is a revisit of the previous video to solve some problems those have had. This is also allows multiple email attachments as opposed to just 1
Views: 30171 optikalefx
mysql has an implode function, its called group_concat Basically it allows you grab many rows from 1 table and concat them by a comma (or other) so you still get your 1 result you were expecting
Views: 5466 optikalefx
jquery slide
This is a quick tutorial of how you can use jquery to make some cool animation effects. It just using the slideToggle and some added CSS3 rounded corners to make it look even better.
Views: 28934 optikalefx
jQuery AJAX Tabs
Sorry Im getting kind of sick. Using $.get we can load any content we want via ajax into a div
Views: 18584 optikalefx
Live Search with Ajax
Live search a mysql database with Mysql, php, jquery, ajax, javascript, html. Sound complicated? Its not. All you have to do is create a keyup listener on a text box and just make sql calls using ajax to grab the data.
Views: 65477 optikalefx
Chrome Extension OOP with Persistent Data
Here we learn how to build a chrome extension with an object oriented mind set. We pass data from background to popup using messages so we can persist data between popup openings.
Views: 3443 optikalefx
PHP mail attachment - sending an attachment with PHP
sending an email with php is easy, an attachment is a bit harder, but possible. Here are somethings you will need from the video (note, just SOME of the things) $content = chunk_split(base64_encode(file_get_contents($file))); $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n"; $header .= "Content-Transfer-Encoding: base64\r\n"; $header .= "Content-Disposition: attachment; filename=\"".$file_name."\"\r\n\r\n"; $header .= "Content-type:text/plain; charset=iso-8859-1\r\n"; $header .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; FAST VIDEO
Views: 84094 optikalefx
Using Text Wrangler - Advanced part 2
find in multiple documents setting up places using regex in find label.(.*) goto line (cmd j) check spelling (shift cmd semi colin) compare 2 files stop re opening everything on start up
Views: 11850 optikalefx
jQuery Simulate Click and Load content from URL
using the hash of a URL we can load certain dynamic content automatically. We can utilize jquery's ability to simulate events.
Views: 14792 optikalefx
HTML5 Canvas - Make and Image Black and White
Using canvas we can write very little code to convert and image into black white. Really all you need to do is use the formular R*.3 + G*.59 + B*.11 and store that as each pixel. In actuality you could use any numbers as long as you store each sub pixel as the same value it will be black and white
Views: 5299 optikalefx
Using Remote PHP files with cURL
using cURL we can call a remote php file and have it process data and send it back all within the same php file before the page ever loads
Views: 11534 optikalefx
OpenJS Grid v2 - Awesome jQuery Data Table
Finally. It's been 8 months, but I finally did it. Complete re write of OpenJS Grid. I don't feel like writing things here all over again, so please go to http://square-bracket.com/openjs to read all about the new version and to get yourself a download. Thanks so much!
Views: 20930 optikalefx
PHP docx Token Replacment
Because docx files are actually just zipped up files and xml, we can unzip them with php, string replace for tokens, and then rezip it all back up. Now you can make cool docx templates for your friends!
Views: 4173 optikalefx
Animate Page Scroll with jQuery
So on pages with lots of anchors (a name) there is a lot of jumping down the page. Well that isn't very nice. So on facebook yesterday I saw when you loaded a page it scrolls to that anchor instead of jumping. So this is a quick and dirty way to make all of your anchors including when the page loads, to scroll instead of jump not ie tested - don't care
Views: 51891 optikalefx
Generate PDFs (From HTML & CSS) with NodeJS and Puppeteer
Oh man! This is a great tool to generate PDFs from HTML. We build a little template engine with handlebars, and render that into a PDF on the fly with puppeteer.
Views: 3803 optikalefx
PHP Sort Array on a Key (using sort method inside of a Class)
Here we learn how to sort an array, based on of the keys in the array, and doing that sort with a function that is inside of a class The sort method uses strnatcasecmp which does a natural string compare that doesn't care about case.
Views: 5031 optikalefx
Remote SSH into Virtual Machine  - vmware fusion mac
this is how to remote into your ubuntu virtual machine running on vmware fusion on your mac basically it goes like this: - outside ip address - specific port on your router - to your computer ip in your house - to the internal port on your router - to the virtual machine external port - to the virtual machine local ip address - using the internal port 22 for ssh
Views: 13682 optikalefx
jquery ajax and json are awesome
I used ajax before, but I never did it with jquery till I recently learned it. I have a function on my billing interface that pops up a box for the user to update some information. Well before I had write out the raw ajax script, checking for browsers etc, and then ajax would return a comma'd string that i would then split with javascript and then allocate that data somewhere. how naiive was I? Now i can just jquery to do the ajax and then return a JSON object with the data which is awesome! Its so much quicker and sooo much less code
Views: 34174 optikalefx
Evenly Space Divs in Javascript - Math Fun
This is why math is fun, and important to learn :D We do some calculations to space out divs equidistant from eachother based on their margin right.
Views: 790 optikalefx
Video on your iPhone Using HTML 5
Using the new HTML 5 we can take your flash movies and play them on the iPhone using the new HTML 5. Video correction: DON'T CHOOSE H264!! Just switch to MPEG-4 and change the video size. The quality isn't that great but that's because were on iPhone. I'll let you know when I find better settings. Don't have Quicktime Pro? Windows: http://www.extensoft.com/?p=free_video_converter Mac: http://www.kigo-video-converter.com/free-video-converter-mac/
Views: 34126 optikalefx
Awesome CSS3 3D Image Slider.  With Flickr!
You know you love CSS3 and HTML5 and all that jazz. Well SliceBox is this amazing 3d image rotator that I fell in love with. The problem is that its all manual. So i made a quick plugin that wraps slicebox with the flickr api (kind of) so slicebox is automatically loaded with flickr! w00t! Source! http://code.google.com/p/slicebox-flickr/downloads/list
Views: 125109 optikalefx
jQuery Load While Scrolling - Ajax
For the full tutorial please watch http://www.youtube.com/watch?v=rxEnxyqRnMY
Views: 8915 optikalefx