Problem:
When uploading svg file with Carrierwave you may get an error:
Failed to manipulate with MiniMagick, maybe it is not an image?
Original Error: `identify /tmp/mini_magick20190222-32759-1g7lnmy.svg` failed with error:
Problem:
When uploading svg file with Carrierwave you may get an error:
Failed to manipulate with MiniMagick, maybe it is not an image?
Original Error: `identify /tmp/mini_magick20190222-32759-1g7lnmy.svg` failed with error:
console.log(1); | |
(_ => console.log(2))(); | |
eval('console.log(3);'); | |
console.log.call(null, 4); | |
console.log.apply(null, [5]); | |
new Function('console.log(6)')(); | |
Reflect.apply(console.log, null, [7]) | |
Reflect.construct(function(){console.log(8)}, []); | |
Function.prototype.apply.call(console.log, null, [9]); | |
Function.prototype.call.call(console.log, null, 10); |
package com.simplelisp; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
public class SimpleLisp { | |
//(+ 3 (+ 3 2) (+ 4 5)) |
// | |
// SimpleScrollingStack.swift | |
// A super-simple demo of a scrolling UIStackView in iOS 9 | |
// | |
// Created by Paul Hudson on 10/06/2015. | |
// Learn Swift at www.hackingwithswift.com | |
// @twostraws | |
// | |
import UIKit |
osascript -e 'tell application "iOS Simulator" to quit' | |
osascript -e 'tell application "Simulator" to quit' | |
xcrun simctl erase all |
#!/bin/bash | |
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
set -e | |
sourceApp="$1" | |
targetApp="$2" | |
while read key value; do |
//Knapsack algorithm | |
//================== | |
// wikipedia: [Knapsack (0/1)](http://en.wikipedia.org/wiki/Knapsack_problem#0.2F1_Knapsack_Problem) | |
// Given a set `[{weight:Number, benefit:Number}]` and a capacity, | |
// find the maximum value possible while keeping the weight below | |
// or equal to the capacity | |
// **params**: | |
// `capacity` : Number, | |
// `items` : [{w:Number, b:Number}] | |
// **returns**: |
# Sample implementation of quicksort and mergesort in ruby | |
# Both algorithm sort in O(n * lg(n)) time | |
# Quicksort works inplace, where mergesort works in a new array | |
def quicksort(array, from=0, to=nil) | |
if to == nil | |
# Sort the whole array, by default | |
to = array.count - 1 | |
end |
Class Main { | |
public void bfs() | |
{ | |
// BFS uses Queue data structure | |
Queue queue = new LinkedList(); | |
queue.add(this.rootNode); | |
printNode(this.rootNode); | |
rootNode.visited = true; | |
while(!queue.isEmpty()) { | |
Node node = (Node)queue.remove(); |