Skip to content

Instantly share code, notes, and snippets.

View devxoul's full-sized avatar
👨‍💻
Always coding

Suyeol Jeon devxoul

👨‍💻
Always coding
View GitHub Profile
@devxoul
devxoul / GoogleAnalytics.podspec
Last active October 27, 2015 17:05
GoogleAnalytics 3.14.0 podspec (This version is not yet uploaded to CocoaPods, so we have to write podspec manually)
Pod::Spec.new do |s|
s.name = "GoogleAnalytics"
s.version = "3.14.0"
s.summary = "Google Analytics - measure your app performance"
s.description = "Google Analytics lets you track application events you care about and gain insights from discovery and installation to conversion and engagement"
s.homepage = "https://www.google.com/analytics"
s.license = { :type => "Copyright", :text => "Copyright 2015 Google Inc." }
s.author = "Google, Inc."
s.platform = :ios, "5.0"
s.frameworks = ["CoreData", "SystemConfiguration"]
/*
* UIButton+TouchAreaInsets.h
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2013 Joyfl
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
@devxoul
devxoul / phone_number_formatter.php
Last active December 15, 2015 17:16
Phone number formatter for Korean.
<?php
function phone($str) {
$AREA_CODES = array("010", "02", "011", "031", "012", "032", "033", "041",
"015", "042", "016", "043", "017", "044", "018", "051",
"019", "052", "053", "054", "055", "061", "062", "063",
"064");
// 하이픈 모두 제거
$flattened = str_replace("-", "", $str);
@devxoul
devxoul / jquery.loadasync.js
Created August 16, 2013 02:35
A jQuery plugin that allows you to load images asynchronously. <img class="async" src="PLACEHOLDER IMAGE URL HERE" async-src="ORIGINAL IMAGE URL HERE"> $(img.async).loadasync();
/*
* jquery.loadasync.js
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2013 Su Yeol Jeon
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
@devxoul
devxoul / replace_url_for_blueprint.py
Last active December 29, 2015 01:49
Replace non-blueprint `url_for` to specific blueprint. e.g. url_for('login') -> url_for('blueprint.login')
import os
import re
BLUEPRINT = 'blueprint'
TARGET_DIR = 'myproject/templates'
RECURSIVE = True
EXTENSIONS = ['py', 'html', 'htm']
pat = "url_for\('(?![a-z]+\.)(?!static)([a-z_]+)"
rep = "url_for('%s.\g<1>" % BLUEPRINT
@devxoul
devxoul / SR-1117.swift
Last active March 31, 2016 09:49
Overridden function is not being called when sublassing generic class in Release Build with Whole Module Optimization. https://bugs.swift.org/browse/SR-1117
/// A generic class
class Parent<T> {
func printName() {
print(self.name())
}
func name() -> String {
return "Parent"
}
set si
set nu
set expandtab
set shiftwidth=4
set tabstop=4
syntax enable
set background=light
colorscheme solarized
@devxoul
devxoul / ObservableConvertibleType+ActivityIndicator.swift
Last active July 29, 2016 14:33
RxSwift: Filters the elements of an observable sequence based on an ActivityIndicator.
// The MIT License (MIT)
//
// Copyright (c) 2016 Suyeol Jeon (xoul.kr)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@devxoul
devxoul / ga-os-version-sub.js
Created September 26, 2016 17:09
Google Analytics OS 버전 합계(%) 구하기
(function() {
var VERSION = '8'
var total = 0;
$('#ID-explorer-table-pieTable tr')
.each(function(i, tr) {
var version = $(tr).find('td:nth-child(3)').text();
if (version.startsWith(VERSION)) {
var percentString = $(tr).find('td:nth-child(5)').text();
var percent = Number(percentString.split('%')[0]);
total += percent;
@devxoul
devxoul / Array+ing.swift
Created October 5, 2016 12:10
Arraying
// The MIT License (MIT)
//
// Copyright (c) 2016 Suyeol Jeon (xoul.kr)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: