How to Handle Uploading Really Large Files in PHP
PHP has some default limits that do not work out of the box when you want to work with uploading very large files. So there are a few configuration changes you have to make to the defaults that come with PHP. These are defined in you php.ini file. The...
Written by Sean Behan on 09/20/2018
How to Chunk Large Files in Swift
How to Chunk Large Files in Swift (4.1) It takes a bit of work but this is the solution I found that finally worked, thanks to this Stack Overflow thread https://stackoverflow.com/questions/46464177/split-data-in-chunks-and-upload-to-server The example ...
Written by Sean Behan on 09/15/2018
Ruby Reload! Method in Non Rails IRB Sessions
I love the Rails reload! function when in the console. I need it in Irb. To get it back this is what I did. If you don't already have an .irbrc file in your home directory, just create it. vim ~/.irbrc or textmate if you prefer mate ~/.irbrc Add this...
Written by Sean Behan on 06/17/2012
Uploading Files with Curl
curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload Courtesy of http://ariejan.net/2010/06/07/uploading-files-with-curl/
Written by Sean Behan on 06/17/2012
Render Partial if File Exists
If you ever want to render a partial but don't want an error thrown you can either check for the existence of the file first params[:controller]+"/sidebar" if File.exists?(RAILS_ROOT+"/app/views/"+params[:controller]+"/_sidebar.html.erb") %> or you ca...
Written by Sean Behan on 06/17/2012
Listing Files and Directories with PHP
Listing all files and directories using PHP 5. <?php $files = array(); $dir = dir("."); while(false!==($file=$dir->read())): if(($file{0}!=".") && ($file{0}!="~") && (substr($file, -3)!="LCK") && ($file!=basename($_SERVER["PHP_SELF"]))): ...
Written by Sean Behan on 06/17/2012
Reading, Writing, Removing Files and Directories in Ruby
These aren't all of them, but I think they are some of the most useful. # making a directory in another directory that doesn't yet exist... FileUtils.mkdir_p '/path/to/your/directory/that/doesnt/exist/yet' # recursively remove a directory and the conten...
Written by Sean Behan on 06/17/2012
the simple things with git
Git can track the file permissions on your source. This can be good, but for small projects on a webserver where permissions change from time to time, and permissions on development app don't match or matter anyway, it's often easier to just skip this che...
Written by Sean Behan on 06/17/2012