Skip to content

Instantly share code, notes, and snippets.

View hdknr's full-sized avatar

hdknr hdknr

View GitHub Profile
@rcoup
rcoup / aws_usage.py
Created June 1, 2010 21:46
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@gourneau
gourneau / python-pil-image-sprite.py
Created April 24, 2011 02:45
Make sprites of images using Python and PIL
#!/usr/bin/python
# This work is licensed under the Creative Commons Attribution 3.0 United
# States License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative
# Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
# from http://oranlooney.com/make-css-sprites-python-image-library/
# Orignial Author Oran Looney <olooney@gmail.com>
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@taichi
taichi / code_reading.md
Last active April 10, 2024 13:04
太一のコードの読み方メモ

太一のコードの読み方メモ

全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。

コードを読むとは何か

  • コードを嗜む
  • コードを学ぶ
  • 武器を手に入れる
@nnnnathann
nnnnathann / gist:3491640
Created August 27, 2012 19:37
Reverse HTTP Proxy (Apache + nodejs)
We couldn’t find that file to show.
@minism
minism / resources.py
Created November 8, 2012 20:26
tastypie ModelResource that respects 'blank' attribute on Model fields
class BaseModelResource(ModelResource):
@classmethod
def get_fields(cls, fields=None, excludes=None):
"""
Unfortunately we must override this method because tastypie ignores 'blank' attribute
on model fields.
Here we invoke an insane workaround hack due to metaclass inheritance issues:
http://stackoverflow.com/questions/12757468/invoking-super-in-classmethod-called-from-metaclass-new
"""
@japboy
japboy / jade-ftw.md
Last active October 23, 2023 11:18
Jade について。

Jade FTW

こんにちは。今回は現実逃避を兼ねて Jade の素晴らしさをお伝えしたいと思います。

Jade とは何か

[Jade][0] は JST (JavaScript Templates) の一つであり、HTML を書くための[軽量マークアップ言語][1] である [Haml][2] に影響を受けた JavaScript テンプレートエンジンでもあります。

@voluntas
voluntas / sentry_django.rst
Last active March 26, 2020 01:23
Sentry + Django コトハジメ
@ferrouswheel
ferrouswheel / conf.py
Last active September 22, 2017 10:50
Sphinx add-on to annotate Django models based on fields and their help_text. Based on https://djangosnippets.org/snippets/2533/ - but adds ForeignKey resolution, and ensure field.rel.to is an actual model instead of a string.
import sys, os
local_path = lambda path: os.path.join(os.path.dirname(__file__), path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'PROJECTNAME.settings'
sys.path.append(local_path('..'))
... # Rest of conf.py goes here
@lothrop
lothrop / gist:8186857
Last active October 2, 2017 21:04
Xamarin.iOS shake animation
public static async Task AnimateShakeAsync(UIView view)
{
await AnimateHorizontalMovementAsync(view, -10);
await AnimateHorizontalMovementAsync(view, 20);
await AnimateHorizontalMovementAsync(view, -20);
await AnimateHorizontalMovementAsync(view, 20);
await AnimateHorizontalMovementAsync(view, -15);
await AnimateHorizontalMovementAsync(view, 10);
await AnimateHorizontalMovementAsync(view, -5);
}