Skip to content

Instantly share code, notes, and snippets.

@mikkpr
mikkpr / README.markdown
Last active June 16, 2017 15:12
Wordpress XML -> Voog articles

Migrating Wordpress articles to Voog

Requirements

  • Ruby (2.0 and newer)
  • gem install voog_api
  • gem install mime-types
  • gem install nokogiri

What to do?

  • Make sure you have enough free space to temporarily hold all the necessary image assets before re-uploading them to Voog
@kaspar-naaber
kaspar-naaber / edicy_to_voog_migration_tasklist.md
Last active September 19, 2016 07:44
Edicy -> Voog migration tasklist

Edicy -> Voog migration tasklist

Basic stuff

  • Let support team do the magic from clientbase side.
  • Wait until the site is running on Voog...

If site is running on Voog, proceed with the following tasks.

  • Pull template to your computer and make it a git repo (optional but reccomended).
  • Make an "initial commit" to save the current stage (if you decided to pull the template).
@pulges
pulges / voogToEmail.js
Created April 29, 2015 10:00
Fix Voog images and urls for email templating (Works in Chrome only)
var saveData = function (blob, fileName) {
var a = document.createElement("a");
document.body.appendChild(a);
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
};
@kaspar-naaber
kaspar-naaber / gist:59437b494fc28867fa82
Created April 9, 2015 08:04
Update Voog content areas
// Article body
Edicy.jQuery.ajax({
type: "PUT",
contentType: "application/json",
url: '/admin/api/articles/566710',
data: JSON.stringify({ body: '' }),
dataType: "json"
});
// Content text
@demisx
demisx / active_record_objects_autosave.md
Last active April 29, 2024 09:02
When Active Record Child Objects are Autosaved in Rails

belongs_to:

  1. Assigning an object to a belongs_to association does not automatically save the object. It does not save the associated object either.

has_one:

  1. When you assign an object to a has_one association, that object is automatically saved (in order to update its foreign key).
  2. In addition, any object being replaced is also automatically saved, because its foreign key will change too
  3. If either of these saves fails due to validation errors, then the assignment statement returns false and the assignment itself is cancelled.
  4. If the parent object (the one declaring the has_one association) is unsaved (that is, new_record? returns true) then the child objects are not saved. They will automatically when the parent object is saved.
@mildmojo
mildmojo / left_join_arel_example.rb
Last active April 5, 2024 16:00
LEFT JOIN in ARel for ActiveRecord in Ruby on Rails
# Here's a contrived example of a LEFT JOIN using ARel. This is an example of
# the mechanics, not a real-world use case.
# NOTE: In the gist comments, @ozydingo linked their general-purpose ActiveRecord
# extension that works for any named association. That's what I really wanted!
# Go use that! Go: https://gist.github.com/ozydingo/70de96ad57ab69003446
# == DEFINITIONS
# - A Taxi is a car for hire. A taxi has_many :passengers.
# - A Passenger records one person riding in one taxi one time. It belongs_to :taxi.
@gereon
gereon / gist:3150445
Created July 20, 2012 12:20
Mac OSX Spotlight Enhancement

Mac OSX Spotlight Enhancement

Add this to Info.plist in /System/Library/Spotlight/RichText.mdimporter/Contents/ and Spotlight will search for source code files.

<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source
@1stvamp
1stvamp / mac-curl-ca-bundle.sh
Created March 22, 2012 12:50
Script to install cURL CA certificates on OS X without macports
#!/bin/bash
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2
tar xzf curl-7.22.0.tar.bz2
cd curl-7.22.0/lib/
./mk-ca-bundle.pl
if [ ! -d /usr/share/curl/ ]; then
sudo mkdir -p /usr/share/curl/
else