Skip to content

Instantly share code, notes, and snippets.

View k4sima's full-sized avatar
🖖
Tout ce qu'un homme est capable d'imaginer, d'autres hommes seront capables.

kasima k4sima

🖖
Tout ce qu'un homme est capable d'imaginer, d'autres hommes seront capables.
View GitHub Profile
@darktable
darktable / SavWav.cs
Created April 6, 2012 05:01
Unity3D: script to save an AudioClip as a .wav file.
// Copyright (c) 2012 Calvin Rien
// http://the.darktable.com
//
// This software is provided 'as-is', without any express or implied warranty. In
// no event will the authors be held liable for any damages arising from the use
// of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
@niwinz
niwinz / dinamic_inheritance.py
Created September 6, 2012 10:24
Dynamic Inheritance with python3
class DynamicInheritance(type):
"""
Dinamicaly modify class with some extra mixins.
"""
def __call__(cls, *args, **kwargs):
_mixins = kwargs.pop("_mixins", None)
if _mixins:
assert isinstance(_mixins, tuple), "_mixin patemeter must be a tuple"
@doi-t
doi-t / setting_default_value.bash
Last active April 2, 2023 11:35
シェル変数のデフォルト値を設定する
#!/bin/bash
foo=${1:-hoge}
echo $foo #$1がなかったらhogeをデフォルト値としてfooに代入する
#var自身にデフォルト値としてhogeを代入としたいので以下のように書きたい
${var:=hoge} #このままでは、hogeが展開されてしまって、hogeなんてコマンドはないとシェル怒られる
echo "1:$var"
var=
@3846masa
3846masa / gist:6218a252ea5b75385552
Created October 20, 2014 05:54
if文の中が1行のとき,どれがベストなのか
/*
if文の中が1行のとき,どれがベストなのか
コメント募集(下記以外の方法でも可)
*/
// 01
if (true) println("true");
// 02
if (true)
@mottosso
mottosso / README.md
Last active August 11, 2022 14:24
Filtering in QML ListView
@mottosso
mottosso / README.md
Created March 21, 2015 15:16
Filtering and logging in QML ListView

Filtering and logging in QML ListView

image

This example illustrates how to intercept log records and visualise them using Python and QML with QAbstractListModel, QSortFilterProxyModel and a custom logging handler.

Usage

Run filtering_log.py; it will load filtering_log.qml which will need to be located in the same directory.

@miyakogi
miyakogi / config.md
Last active February 8, 2024 08:57
JSON, YAML, ini, TOML ざっくり比較
@vannell
vannell / sandbox.qml
Last active July 4, 2022 08:35
QML Rectangle intersection calculation
import QtQuick 2.4
Item {
id: root
width: 800
height: 600
property int xOverlap: 0
@djrobstep
djrobstep / sqlalchemy_dynamic_table_creation.py
Created May 18, 2016 14:28
SQLAlchemy ORM code to create SQL tables from a dynamically defined column list
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from sqlalchemy import Column, MetaData, Table, create_engine
from sqlalchemy import String, Integer, Float, BigInteger, DateTime
from sqlalchemy.schema import DropTable, CreateTable
from sqlalchemy.orm import scoped_session, sessionmaker
@mignonstyle
mignonstyle / markdown-cheatsheet.md
Last active June 14, 2024 04:30
Markdown記法 チートシート

Block Elements ## Headers 見出し 先頭に#をレベルの数だけ記述します。 ```

見出し1

見出し2

見出し3

見出し4

見出し5
見出し6
## 見出し2
### 見出し3
#### 見出し4
##### 見出し5
###### 見出し6 ## Block 段落 空白行を挟むことで段落となります。 ```
段落1
(空行)
段落2
``` 段落1 段落2 ## Br 改行 改行の前に半角スペース` `を2つ記述します。 ```
hoge
fuga(スペース2つ)
piyo
``` hoge
fuga piyo ## Blockquotes 引用 先頭に`>`を記述します。ネストは`>`を多重に記述します。 ```
> 引用 > 引用
>> 多重引用
``` > 引用 > 引用
>> 多重引用 ## Code コード `` `バッククオート` `` 3つ、あるいはダッシュ`~`3つで囲みます。 ```
print 'hoge'
``` ```
print 'hoge'
``` ### インラインコード `` `バッククオート` `` で単語を囲むとインラインコードになります。 ```
これは `インラインコード`です。
``` これは `インラインコード`です。 ## pre 整形済みテキスト 半角スペース4個もしくはタブで、コードブロックをpre表示できます ``` class Hoge def hoge print 'hoge' end end
``` class Hoge def hoge print 'hoge' end end ## Hr 水平線 アンダースコア`_` 、アスタリスク`*`、ハイフン`-`などを3つ以上連続して記述します。 ```
hoge
***
hoge
___
hoge
---
``` hoge
***
hoge
___
hoge
--- # Lists ## Ul 箇条書きリスト ハイフン`-`、プラス`+`、アスタリスク`*`のいずれかを先頭に記