Skip to content

Instantly share code, notes, and snippets.

@jangxyz
jangxyz / ts-extend.sh
Last active March 27, 2024 06:23
One-liner tsconfig generator bash function
# One-liner tsconfig generator bash function
# inspired by https://stackoverflow.com/a/60950355/1405998
# Usage:
# tsc -p $(ts_extend "src/temp.ts") --outDir dist
function ts_extend() {
local includeFile=$1
TS_IIFE_CONFIG=.tsconfig-extend.json
echo '{ "extends": "./tsconfig.json", "include": ["'${includeFile}'"] }' > $TS_IIFE_CONFIG
@jangxyz
jangxyz / extract_detected_faces.sql
Created November 2, 2023 07:18
How to extract face matching info from macos Photos app
-- get photo filename that has matching name
SELECT
ZA.Z_PK,ZA.ZORIGINALFILENAME,ZA.ZEXIFTIMESTAMPSTRING
FROM
ZADDITIONALASSETATTRIBUTES AS ZA,
ZDETECTEDFACE AS ZDF,
ZPERSON AS ZP
WHERE
ZP.ZDISPLAYNAME = 'YOUR NAME HERE' AND
@jangxyz
jangxyz / #1 React로 간단한 템플릿 생성하기.md
Last active August 12, 2016 10:03
react로 개발하는 순서
  • 간단한 화면 렌더링하기 (#9cee64b)
    • 빌드: webpack src/main.jsx dist/bundle.js --module-bind 'jsx=babel-loader?presets=react'
  • webpack으로 빌드 #5542b96
  • webpack-dev-server --inline --hot으로 빌드 #26c5c639
@jangxyz
jangxyz / 신논현_커피.markdown
Created December 14, 2015 01:31
신논현역 근처 커피가 맛있을거 같은 카페 조사
@jangxyz
jangxyz / app.js
Created December 8, 2015 14:06
SemanticUI Modal with React-0.14.3
var HelloModal = React.createClass({
render: function() {
console.log('HelloModal#render', this.props.visible);
var modal_classes = (this.props.visible) ?
'ui small modal transition visible active' :
'ui small modal transition hidden';
return (
<div className={modal_classes}>
<div className="ui center aligned header">Hello</div>
<div className="content">
@jangxyz
jangxyz / fly_spec.coffee
Last active August 29, 2015 14:16
Decorators in JavaScript
describe Flying, ->
it 'receives a constructor function and returns one.', ->
Superman = Flying(Human)
expect(Superman).to.be.a(Function)
it "calls the target class's constructor on init", ->
# mock Human
man_is_called = false

별다른 작업 않고 그냥 render가 되게끔 해보자

현재:

  <% entry = exhibit(entry, self) %>
  <article>
    <header>
 &lt;%= entry.pubdate %&gt;
<!-- app/views/posts/_post.html.erb -->
<article>
<header>
<p><time pubdate="pubdate"><%= post.pubdate %></time></p>
<h3><%= post.title %></h3>
<div class="entry_tags">Tags:
<%= post.tags.render(self) %>
</div>
</header>
<%= post.render_body(self) %>
@jangxyz
jangxyz / module_test_suite_runner.py
Created February 15, 2013 18:13
Subclass of DjangoTestSuiteRunner, to run every test cases from a module with Django. I think this is more pythonic than Django's.
import django.test.simple as dj_test
from django.test.simple import unittest
class ModuleTestSuiteRunner(dj_test.DjangoTestSuiteRunner):
def build_suite(self, test_labels, extra_tests=None, **kwargs):
suite = unittest.TestSuite()
if test_labels:
for label in test_labels:
if '.' in label: