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
@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やデータやメソッドについて定義出来る
@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

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

@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@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
@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
@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}'
@shinyaohira
shinyaohira / View Controller Programming Guide for iOS.md
Last active July 19, 2023 13:23
iOS View Controllerプログラミングガイド

storyboard上で、initial view controllerから他のview controllerに対してrelationshipを確立します。同様に、それらのview controllerから他のview controllerにrelationshipを確立します。最終的に、storyboard上のほとんど、あるいは全てのview controllerを一つのグラフに接続します。接続されたview controllerが、iOSによっていつインスタンス化されるかは、relationshipのタイプによって決まります。

@pocotan001
pocotan001 / globals.snippets.js
Last active April 29, 2023 15:03
Finding improper JavaScript globals.
// globals.js
// https://gist.github.com/pocotan001/6305714
// Finding improper JavaScript globals
(function() {
var prop, cleanWindow,
globals = new function globals() {},
body = document.body,
iframe = document.createElement('iframe'),
ignore = {
@ismell
ismell / README.md
Last active September 10, 2016 15:39
Docker Ubuntu upstart scripts

Production Ready Process Monitoring

  1. Install docker-manger.conf and docker-instance.conf in /etc/init

  2. Create a containers file in /etc/docker/ with the following format

     name: image cmd
    

    The name must be unique.

  3. sudo service docker-manager start