Skip to content

Instantly share code, notes, and snippets.

View oboje's full-sized avatar
🎯
Focusing

Igor Popov oboje

🎯
Focusing
  • New York
View GitHub Profile
@oboje
oboje / rubynotes.sh
Created October 22, 2017 15:37
rubynotes.sh
#swagger ruby fix
grep -rl "ActiveRecord::Migration$" db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g"
@oboje
oboje / Untitled-1
Created October 7, 2017 19:53
ios links
https://www.raizlabs.com/dev/2014/02/animating-items-in-a-uicollectionview/
@oboje
oboje / cloudSettings
Last active April 14, 2020 13:58
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-14T13:58:45.149Z","extensionVersion":"v3.4.3"}
@oboje
oboje / keybindings.json
Created September 17, 2017 11:25
keybindings.json
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+t",
"command": "openInTerminal.openIntegrated"
},
{
"key": "shift+cmd+t",
"command": "openInTerminal.openRootIntegrated"
},
public extension FloatingPoint {
/// Re-maps a number from one range to another.
///
/// - Parameters:
/// - source: The range to interpret the number as being a part of.
/// - destination: The range to map the number to.
/// - clamped: Whether the result should be clamped to the `to` range. Defaults to `false`.
/// - reversed: whether the output mapping should be revserd, such that
/// as the input increases, the output decreases. Defaults to `false`.
@oboje
oboje / convert.sh
Last active September 1, 2017 19:38
converting flac to mp3
#!/bin/bash
# bootstrap: brew install lame flac
for f in *.flac; do
[[ "$f" != *.flac ]] && continue
album="$(metaflac --show-tag=album "$f" | sed 's/[^=]*=//')"
artist="$(metaflac --show-tag=artist "$f" | sed 's/[^=]*=//')"
date="$(metaflac --show-tag=date "$f" | sed 's/[^=]*=//')"
@oboje
oboje / UIVisualEffect.swift
Created January 21, 2017 12:26 — forked from ilyapuchka/UIVisualEffect.swift
(Ab)using UIVisualEffectView effect settings
extension UIVisualEffectView {
private var filterLayer: CALayer? {
return layer.sublayers?.first
}
private var blurFilter: NSObject? {
return filterLayer?
.filters?.flatMap({ $0 as? NSObject })
.first(where: { $0.value(forKey: "name") as? String == "gaussianBlur" })
@oboje
oboje / gist:8d18df1a1c39d3ea3440c38d9a30a515
Last active November 30, 2016 06:32
Localization: making strings file
#to gen string files
find ./ -name "*.m" -exec echo {} \; -exec genstrings -a -o en.lproj {} \;
#proper macros
NSLocalizedStringWithDefaultValue
@oboje
oboje / Tools.m
Created November 15, 2016 12:09
Obj-C Categories / Helpers
@interface Tools: NSObject
+ (UIColor *)colorWithHex:(NSUInteger)hex;
@end
@implementation Tools
+ (UIColor *)colorWithHex:(NSUInteger)hex