This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Does a bulk change of email addresses stored in a Drupal 6 database, eg from *@example.com to *@new-example.com | |
| * | |
| * Ensure that a backup is taken before running this. | |
| * 0. TAKE A BACKUP OF YOUR DATABASE - mysqldump -u[username] -p[password] [dbname] > [dbname].sql | |
| * 1. Fill out the details below | |
| * 2. Upload this somewhere accessible over the web | |
| * 3. Point your browser to it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Takes a filesize integer and returns a decently formatted string | |
| * This function needs to go into template.php, don't forget to change the theme name below | |
| * Call it like this: | |
| * - print mytheme_format_filesize($node->field_downloads[0]['filesize'] | |
| */ | |
| function mytheme_format_filesize($filesize) { | |
| if ($filesize < 1024) { | |
| return $filesize . ' bytes'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To get form error states showing properly using Bootstrap with Rails, use (in config/application.rb): | |
| config.action_view.field_error_proc = Proc.new { |html_tag, instance| "<div class=\"control-group error\">#{html_tag}</div>".html_safe } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var humanFilesize = function(bytes){ | |
| if (bytes < 1024) | |
| return bytes + ' bytes'; | |
| if (bytes < 1048576) | |
| return (bytes / 1024) + ' kB'; | |
| if (bytes < 1073741824) | |
| return bytes / 1048576 + ' MB'; | |
| if (bytes < 1099511627776) | |
| return (bytes / 1073741824) + ' GB'; | |
| return (bytes / 1099511627776) + ' TB'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Enable Apache modules if they're not already | |
| LoadModule proxy_module modules/mod_proxy.so | |
| LoadModule proxy_http_module modules/mod_proxy_http.so | |
| 2. Set up the proxy in a vhost | |
| ProxyPass /localdir http://example.com/remotedir | |
| ProxyPassReverse /localdir http://example.com/remotedir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # app/config/deploy.rb | |
| # Replace strings in "CAPITALS" | |
| # Assumptions, adjust to taste: | |
| # - Using Composer | |
| # - No git on remote server | |
| # - Staging and production environments are on the same IP | |
| # - Database and webserver are on the same IP | |
| # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Edit the following with relevant details | |
| uid="" | |
| key="" | |
| endpoint="" | |
| file_to_upload="/local/path/to/large/file.ext" | |
| atmos_dir="/test/" | |
| contentType="image/jpeg" | |
| # Stop editing here | |
| filename=`basename $file_to_upload` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source ~/.git-prompt.sh | |
| export PS1='\[\033[0;31m\]$(__git_ps1 " (%s)") \[\033[0;37m\]~ ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Produces HTML5 friendly video formats | |
| # Usage (OSX): | |
| # brew install ffmpeg --with-libvpx --with-libvorbis --with-theora | |
| # curl https://gist.githubusercontent.com/okjake/7d347f26b8bdc9496b67/raw/f2c91daf1ebacc3c117d8b304403f03b157f1109/gistfile1.txt > cnv.sh && chmod u+x cnv.sh | |
| # cnv.sh /path/to/video1.mp4 /path/to/video2.mov | |
| if [ ! $# -gt 0 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "patterns": [ | |
| { | |
| "id": "news-card-audio-001", | |
| "name": "Audio Card", | |
| "product": "News", | |
| "type": "Card", | |
| "inUse": true, | |
| "description": "Used to play audio without leaving the current page", | |
| "owner": "test@example.com", |
OlderNewer