Skip to content

Instantly share code, notes, and snippets.

View tokuda109's full-sized avatar
🐥
pith pith pith

Tsuyoshi Tokuda tokuda109

🐥
pith pith pith
View GitHub Profile
@payliu
payliu / OLCustomCocoaLumberjack.podspec
Last active December 22, 2015 19:19
Custom Level and Formatter for CocoaLumberjack
Pod::Spec.new do |s|
s.name = 'OLCustomCocoaLumberjack'
s.version = '0.0.4'
s.license = 'MIT'
s.summary = 'Custom Level and Formatter for CocoaLumberjack.'
s.homepage = 'https://gist.github.com/payliu/6519088'
s.author = { 'Pay Liu' => '[email protected]' }
s.source = { :git => 'https://gist.github.com/6519088.git', :tag => '0.0.4' }
s.source_files = '*.{h,m}'
@alanhamlett
alanhamlett / api.py
Last active October 21, 2024 14:30
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort
@RishabhVerma
RishabhVerma / Flask-Restful_S3_File_Upload.py
Last active November 3, 2021 01:41
Uploading a file to S3 while using Flask with Flask-Restful to create a REST API.
# -*- coding: utf-8 -*-
"""
An example flask application showing how to upload a file to S3
while creating a REST API using Flask-Restful.
Note: This method of uploading files is fine for smaller file sizes,
but uploads should be queued using something like celery for
larger ones.
"""
from cStringIO import StringIO
@bomberstudios
bomberstudios / sketch-plugins.md
Last active July 16, 2025 18:21
A list of Sketch plugins hosted at GitHub, in no particular order.
@studiomohawk
studiomohawk / extra.extra-advent-calendar.md
Last active April 27, 2016 07:45
とあるレコメンデーションAPI(クローズド)について。[Frontrend Advent Calendar 2013](http://www.adventar.org/calendars/62)の15日目への寄稿。

Extra! Extra!

16世紀から17世紀にかけてのイングランドの哲学者であるFrancis Baconは:

人間の知識と力は一致する、というのも、原因を知らなければ、結果を生み出すこともできないからだ。

という言葉を著書"ノヴム・オルガヌム"に残した。

私、斉藤祐也(@cssradar)はすでにご存じの方も多いかもしれないが、情報を収集しニュースを書くための学問であるジャーナリズムを専攻し、巡り巡って現在はフロントエンド開発者をしている。

@JedWatson
JedWatson / 1-proposal.md
Last active January 2, 2024 17:59
Proposal: adding reverse-relationship population to Mongoose (as implemented in KeystoneJS)

I've developed a useful feature in KeystoneJS that lets you populate a relationship from either side, while only storing the data on one side, and am looking for feedback on whether it is something that could / should be brought back into mongoose itself. (It might be possible to add as a separate package but I suspect there'd be too much rewriting of mongoose internals for that to be a good idea).

I've added this as an issue in mongoose for consideration: #1888 but am leaving this gist in place because the examples are easier to read.

I've used Posts and Categories as a basic, contrived example to demonstrate what I'm talking about here; in reality you'd rarely load all the posts for a category but there are other real world cases where it's less unreasonable you'd want to do this, and Posts + Categories is an easy way to demo it.

The problem

The built-in population feature is really useful; not just for

@koba04
koba04 / api.md
Last active November 2, 2024 00:52
Vue.js note(v0.10.3). not translate. This is draft of https://github.com/koba04/vuejs-book .

API

Class: Vue

  • Vueはvue.jsのコアとなるコンストラクタ
  • インスタンスが作られたときにデータバインディングが開始される
  • オプションを取ることも出来て、DOMやデータやメソッドについて定義出来る
@0xced
0xced / UIPageViewController+ReloadData.h
Last active May 16, 2020 02:51
Reload data workaround for UIPageViewController
#import <UIKit/UIPageViewController.h>
// Because UIPageViewController somehow "caches" its view controllers when you pass animated:YES and there is no "reloadData" method in UIPageViewControllerDataSource
@interface UIPageViewController (ReloadData)
- (void) xcd_setViewControllers:(NSArray *)viewControllers direction:(UIPageViewControllerNavigationDirection)direction animated:(BOOL)animated completion:(void (^)(BOOL))completion;
@end
@yasushiyy
yasushiyy / vagrant_coreos_docker.md
Last active January 28, 2019 11:35
Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。

2014年6月11日時点での情報。

  • Version: CoreOS 343.0.0
  • Kernel: 3.14.5
  • Docker: 1.0
@bennadel
bennadel / isolate-scope-directive.htm
Created June 16, 2014 12:15
Using Isolate Scope In Directives In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Using Isolate Scope In Directives In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>