Skip to content

Instantly share code, notes, and snippets.

@koukyo1994
koukyo1994 / .gitkeep
Last active March 13, 2021 10:35
atmaCup10
temp
@raven38
raven38 / noglobal.py
Created December 6, 2020 08:23 — forked from yoshipon/noglobal.py
Useful Noglobal in Python
# License:
# I hereby state this snippet is below "threshold of originality" where applicable (public domain).
#
# Otherwise, since initially posted on Stackoverflow, use as:
# CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl
# http://stackoverflow.com/a/31047259/2719194
# http://stackoverflow.com/a/4858123/2719194
import builtins
import types
@otaon
otaon / 000_how-to-construct-environment-for-common-lisp.md
Last active July 23, 2022 08:52
vim と slimv と roswell と swank で common lisp を書く環境を作る

本記事の位置づけ

下記を実現するための手順書。

  • roswell(lisp実行環境構築ツール)を導入する
  • slimv(VimにおけるSLIME)を導入する
  • roswellとslimvでcommon lispをコーディング、実行するための設定をする

手順一覧

下記の順番に環境構築する。

@markus-beuckelmann
markus-beuckelmann / numpy-benchmark.py
Created April 30, 2017 13:06
A short Python script to benchmark NumPy and show your BLAS setup
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Roughly based on: http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration
from __future__ import print_function
import numpy as np
from time import time
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@ax3l
ax3l / noglobal.py
Last active December 26, 2022 12:44
Useful Noglobal in Python
# License:
# I hereby state this snippet is below "threshold of originality" where applicable (public domain).
#
# Otherwise, since initially posted on Stackoverflow, use as:
# CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl
# http://stackoverflow.com/a/31047259/2719194
# http://stackoverflow.com/a/4858123/2719194
import types
@bzamecnik
bzamecnik / README.md
Last active November 16, 2023 08:58
Anaconda Python script running as systemd service

Anaconda Python script running as systemd service

This way a Python daemon can be installed on Rasbian, Ubuntu or similar systems using systemd.

Installing:

sudo cp hello.service /lib/systemd/system/hello.service
sudo systemctl daemon-reload
sudo systemctl enable hello.service
@y-takagi
y-takagi / DOCUMENT.md
Last active April 29, 2024 16:36
iOSでデータを永続化する方法

How to save data in iOS

この投稿では、iOSのファイルシステムについて理解し、データを永続化(iCloud含む)する方法を紹介する。尚、サンプルコードは動かない可能性もあるので参考程度にして下さい。

iOS File System

アプリがファイルシステムとやり取り出来る場所は、ほぼアプリのサンドボックス内のディレクトリに制限されている。新しいアプリがインストールされる際、インストーラーはサンドボックス内に複数のコンテナを作成し、図1に示す構成をとる。各コンテナには役割があり、Bundle Containerはアプリのバンドルを保持し、Data Containerはアプリとユーザ両方のデータを保持する。Data Containerは用途毎に、さらに複数のディレクトリに分けられる。アプリは、例えばiCloud Containerのように、実行時に追加のコンテナへのアクセスをリクエストすることもある。

IMG_0017_RESIZE.png

図1. An iOS app operating within its own sandbox

@somma
somma / multiprocessing with instance method
Last active March 25, 2022 19:54
Code illustrates how to pass instance method to multiprocessing and use functools.partial with pool.map() method.
#!/usr/bin/python
# -*- coding:utf-8 -*-
"""
Idea and code was taken from stackoverflow().
This sample illustrates how to
+ how to pass method of instance method
to multiprocessing(idea and code was introduced
at http://goo.gl/tRHN1D by torek).
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 8, 2024 07:49
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname