Skip to content

Instantly share code, notes, and snippets.

View wozozo's full-sized avatar
😇
Hello

Yoichi Fujimoto wozozo

😇
Hello
  • Tokyo, Japan
  • 15:53 (UTC +09:00)
  • X @wozozo
View GitHub Profile
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active March 29, 2024 03:45
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@voluntas
voluntas / shiguredo_tech.rst
Last active March 19, 2024 04:42
時雨堂を支える技術

時雨堂を支える技術

日時

2024-03-17

時雨堂

バージョン

2024.3

URL

https://shiguredo.jp/

時雨堂クラウドサービスを支える技術

@sigilioso
sigilioso / cuter.py
Created June 19, 2012 22:58
Python PIL Example: get a thumbnail by resizing and cropping an image.
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.

How to use swift in your terminal

setup

First, install Xcode 6 beta.

And run it.

sudo xcode-select -switch /Applications/Xcode6-Beta.app/Contents/Developer
@neara
neara / forms.py
Last active February 10, 2023 01:18
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor
@RobertSzkutak
RobertSzkutak / ircecho.py
Created October 30, 2011 21:15
Echo, a simple IRC bot written in Python 3
#!/usr/bin/env python3
# ircecho.py
# Copyright (C) 2011 : Robert L Szkutak II - http://robertszkutak.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);
@jupiterjs
jupiterjs / JavaScriptMVC.md
Created May 24, 2011 16:58 — forked from moschel/JavaScriptMVC.md
JavaScriptMVC Overview

The following is a VERY rough draft of an article I am working on for Alex MacCaw's @maccman's Book. It is very rough, but even now a worthwhile read. Suggestions / comments are very welcome! Please help me :-)

Introduction

JavaScriptMVC (JMVC) is an open-source jQuery-based JavaScript framework. It is nearly a comprehensive (holistic) front-end development framework, packaging utilities for testing, dependency management, documentation, and a host of useful jQuery plugins.

Yet every part of JavaScriptMVC can be used without every other part, making the library lightweight. Its Class, Model, View, and Controller combined are only 7k minified and compressed, yet even they can be used independently. JavaScriptMVC's independence lets you start small and scale to meet the challenges of the most complex applications on the web.

This chapter covers only JavaScriptMVC's $.Class, $.Model, $.View, and $.Controller. The following describes each component:

@voluntas
voluntas / django-s3-imagekit-celery.rst
Last active May 13, 2022 13:46
S3 と非同期サムネイル作成 コトハジメ

S3 と非同期サムネイル作成 コトハジメ

更新

2013-12-08

バージョン

0.1.8

作者

@voluntas

URL

http://voluntas.github.io/

概要

@bendc
bendc / merge.js
Created July 21, 2016 14:15
Deep merge of JSON-like objects
const merge = (() => {
const duplicate = object => JSON.parse(JSON.stringify(object));
return (...objects) => Object.assign(...objects.map(duplicate));
})();