Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nurettin Onur TUĞCU nurettin

🏠
Working from home
View GitHub Profile
@nurettin
nurettin / eca_fluid_sim.py
Last active Aug 16, 2020 — forked from nst/eca_fluid_sim.py
Fluid simulation from 1D cellular automata
View eca_fluid_sim.py
#!/usr/bin/env python
# Idea: YankeeMinstrel
# Python code: torstengrust
# Animated GIF: Nicolas Seriot, 2017-07-01
# https://www.reddit.com/r/cellular_automata/comments/6jhdfw/i_used_1dimensional_cellular_automata_to_make_a/
from PIL import Image, ImageDraw
import os
View fener.json
{"nodes": [{"id": "ADBGR", "group": 1}, {"id": "ALARK", "group": 1}, {"id": "AKBNK", "group": 1}, {"id": "AEFES", "group": 1}, {"id": "ADANA", "group": 1}, {"id": "ADEL", "group": 1}, {"id": "ADNAC", "group": 1}, {"id": "ALCAR", "group": 1}, {"id": "AKFGY", "group": 1}, {"id": "AKMGY", "group": 1}, {"id": "AKSEL", "group": 1}, {"id": "ALCTL", "group": 1}, {"id": "ANELE", "group": 1}, {"id": "AKPAZ", "group": 1}, {"id": "AKSGY", "group": 1}, {"id": "ALGYO", "group": 1}, {"id": "AKSUE", "group": 1}, {"id": "ACSEL", "group": 1}, {"id": "ALKIM", "group": 1}, {"id": "ALBRK", "group": 1}, {"id": "AGYO", "group": 1}, {"id": "ALKA", "group": 1}, {"id": "AKCNS", "group": 1}, {"id": "AKSEN", "group": 1}, {"id": "AKSA", "group": 1}, {"id": "AKENR", "group": 1}, {"id": "ALYAG", "group": 1}, {"id": "ADESE", "group": 1}, {"id": "AFYON", "group": 1}, {"id": "ANACM", "group": 1}, {"id": "AKGRT", "group": 1}, {"id": "AKGUV", "group": 1}, {"id": "ANELT", "group": 1}, {"id": "ANSGR", "group": 1}, {"id": "ARMDA", "group": 1}, {"
View data.json
{"nodes": [{"id": "ADBGR", "group": 1}, {"id": "ALARK", "group": 1}, {"id": "AKBNK", "group": 1}, {"id": "AEFES", "group": 1}, {"id": "ADANA", "group": 1}, {"id": "ADEL", "group": 1}, {"id": "ADNAC", "group": 1}, {"id": "ALCAR", "group": 1}, {"id": "AKFGY", "group": 1}, {"id": "AKMGY", "group": 1}, {"id": "AKSEL", "group": 1}, {"id": "ALCTL", "group": 1}, {"id": "ANELE", "group": 1}, {"id": "AKPAZ", "group": 1}, {"id": "AKSGY", "group": 1}, {"id": "ALGYO", "group": 1}, {"id": "AKSUE", "group": 1}, {"id": "ACSEL", "group": 1}, {"id": "ALKIM", "group": 1}, {"id": "ALBRK", "group": 1}, {"id": "AGYO", "group": 1}, {"id": "ALKA", "group": 1}, {"id": "AKCNS", "group": 1}, {"id": "AKSEN", "group": 1}, {"id": "AKSA", "group": 1}, {"id": "AKENR", "group": 1}, {"id": "ALYAG", "group": 1}, {"id": "ADESE", "group": 1}, {"id": "AFYON", "group": 1}, {"id": "ANACM", "group": 1}, {"id": "AKGRT", "group": 1}, {"id": "AKGUV", "group": 1}, {"id": "ANELT", "group": 1}, {"id": "ANSGR", "group": 1}, {"id": "ARMDA", "group": 1}, {"
@nurettin
nurettin / holyshit.sql
Created Apr 4, 2020
declarative json postgresql
View holyshit.sql
select row_to_json(q) from (
select
row_to_json(a) account
, json_agg(t) trades
from pm_account a
left join lateral (
select
row_to_json(t) trade
, json_agg(d) dailies
, json_agg(sf) smartorders
View async_keyboard_example.py
import asyncio
class Prompt:
def __init__(self, loop=None):
self.loop = loop or asyncio.get_event_loop()
self.q = asyncio.Queue(loop=self.loop)
self.loop.add_reader(sys.stdin, self.got_input)
def got_input(self):
asyncio.ensure_future(self.q.put(sys.stdin.readline()), loop=self.loop)
View raspivid service
#!/bin/sh
/usr/bin/raspivid --brightness 65 --saturation 25 -ex auto -n -ih -t 0 -rot 75 -w 1480 -h 1200 -fps 15 -b 1000000 -o - | /usr/bin/ncat -lkv4 5001
@nurettin
nurettin / art.sql
Created May 9, 2018
group rows by pilot row, show line numbers and line count
View art.sql
select
i
, c
, g
, gi
, sum(1) over (partition by g) gn
from (
select
i
, c
@nurettin
nurettin / Gemfile
Last active Feb 10, 2018
simple solution to einstein's riddle (also known as zebra puzzle)
View Gemfile
source "https://rubygems.org"
gem "csp-solver"
gem "terminal-table"
View SqlWorkbenchExplain.pas
program SQLWorkbenchExplain;
{$APPTYPE CONSOLE}
uses
SysUtils, Classes, JclSysUtils, IniFiles;
type
TConfig = record
LogFile: string;
View gist:fd39c5cbea4141698837b8f78d5be1bb
### Keybase proof
I hereby claim:
* I am nurettin on github.
* I am nurettin (https://keybase.io/nurettin) on keybase.
* I have a public key whose fingerprint is 7687 787E A662 029F 2DD6 94CF 9B86 DFB2 25ED E4CB
To claim this, I am signing this object:
You can’t perform that action at this time.