Skip to content

Instantly share code, notes, and snippets.

View theeluwin's full-sized avatar
🎹
스콜라아이돌교수버튜버

Jinseok Seol theeluwin

🎹
스콜라아이돌교수버튜버
View GitHub Profile
├─┬ angular-route#1.2.20 extraneous (1.2.21-build.341+sha.5d11e02 available, latest is 1.3.0-build.2977+sha.11f5aee)
│ └── angular#1.2.20 (latest is 1.3.0-build.2977+sha.11f5aee)
├─┬ angular-sanitize#1.2.20 extraneous (1.2.21-build.341+sha.5d11e02 available, latest is 1.3.0-build.2977+sha.11f5aee)
│ └── angular#1.2.20
├── angular-seo#e801dc02ed extraneous
├── angular-ui-bootstrap#0.11.0 extraneous
├─┬ angular-ui-router#0.2.10 extraneous
│ └── angular#1.2.20 (1.3.0-build.2977+sha.11f5aee available)
├── bootstrap#3.2.0 extraneous
├─┬ bootstrap-datepicker#1.3.0 extraneous
@theeluwin
theeluwin / filters.js
Created July 28, 2014 08:39
useful angular filters
// converts link in text into anchor
app.filter("link_finder", function(){
return function(input){
return input? input.replace(/(\bhttps?:\/\/[^\s<>"`{}|\^\[\]\\]+)/g, "<a href='$1' target='new'>$1</a>") : "";
};
});
// escape '<' and '>'
app.filter("escape_html", function(){
return function(input){
@theeluwin
theeluwin / dead angular
Created November 9, 2014 15:45
rock is dead.
app.config(function($provide){
$provide.decorator("$browser", ["$delegate", function($delegate){
$delegate.onUrlChange = function(){};
$delegate.url = function(){return "";};
return $delegate;
}]);
});
def price(value):
parts = str(value).split('.')
parts[0] = re.sub('\B(?=(\d{3})+(?!\d))', ',', parts[0])
return '.'.join(parts)
@theeluwin
theeluwin / infinite-monkey-sort.py
Created January 14, 2015 13:35
Simple integer sorting algorithm based on infinite monkey theorem (http://en.wikipedia.org/wiki/Infinite_monkey_theorem).
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
import unittest
def infinite_monkey_sort(numbers):
length = len(str(numbers))
while True:
@theeluwin
theeluwin / harakiri.py
Created January 22, 2015 09:22
please, kill yourself
import os
os.system('sudo kill -9 %d' % os.getpid())
@theeluwin
theeluwin / pilfer.py
Created March 15, 2015 11:50
코딩 전력 60분 13일의 금요일
# -*- coding: utf-8 -*-
# https://twitter.com/Code_60/status/577062012250796032
import tweepy
API_KEY = 'YOUR_APP_KEY_HERE'
API_SECRET = 'YOU_APP_SECRET_HERE'
auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
api = tweepy.API(auth)
@theeluwin
theeluwin / comma.py
Created June 26, 2015 06:04
Decimal mark regex (python example).
import re
def comma(value):
if not value.isdigit():
raise ValueError("input must be an integer")
return re.sub('\B(?=(\d{3})+(?!\d))', ',', str(int(value)))
@charset "utf-8";
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
-webkit-appearance: none;
-moz-appearance: none;
}
select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: checkbox-container;
@charset "utf-8";
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
-webkit-appearance: none;
-moz-appearance: none;
}
select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: checkbox-container;