Skip to content

Instantly share code, notes, and snippets.

View andreortiz82's full-sized avatar
🎯
Focusing

Andre Ortiz andreortiz82

🎯
Focusing
View GitHub Profile
@andreortiz82
andreortiz82 / url-param.cljs
Created January 9, 2019 16:39 — forked from kordano/url-param.cljs
URL parameter parsing with clojurescript
(defn parse-params
"Parse URL parameters into a hashmap"
[]
(let [param-strs (-> (.-location js/window) (split #"\?") last (split #"\&"))]
(into {} (for [[k v] (map #(split % #"=") param-strs)]
[(keyword k) v]))))
@andreortiz82
andreortiz82 / UIImage+FixOrient.m
Created September 27, 2011 22:54 — forked from densa/UIImage+FixOrient.m
UIImage fix orientation
- (UIImage *)fixOrientation {
// No-op if the orientation is already correct
if (self.imageOrientation == UIImageOrientationUp) return self;
// We need to calculate the proper transformation to make the image upright.
// We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored.
CGAffineTransform transform = CGAffineTransformIdentity;
switch (self.imageOrientation) {