Skip to content

Instantly share code, notes, and snippets.

View tayfun's full-sized avatar
👹
everything is awesome

Tayfun Sen tayfun

👹
everything is awesome
View GitHub Profile
@tayfun
tayfun / CustomChannelPreview.tsx
Created August 24, 2023 10:19
sendbird custom channel preview override
import { useSendbirdStateContext } from "@sendbird/uikit-react";
import ChannelPreview from "@sendbird/uikit-react/ChannelList/components/ChannelPreview";
import SendbirdUIKitGlobal from 'SendbirdUIKitGlobal';
interface CustomChannelPreviewInterface extends SendbirdUIKitGlobal.ChannelPreviewInterface {
startupId: number;
}
const CustomChannelPreview = (props:CustomChannelPreviewInterface) => {
@tayfun
tayfun / Makefile
Created October 31, 2018 10:31
Makefile for building lambda for Sharp with bmp support
SHELL := /bin/bash
all: docker-image compile package
docker-image:
docker build --tag lambci/lambda:vips .
compile-origin-response:
# `compile-*` is only run so that we have node_modules dir with
# dependencies that can be packaged into a zip file with `package` target
@tayfun
tayfun / Dockerfile
Created October 31, 2018 10:28
Dockerfile for building docker image with vips manually installed
# Because we now use shared libraries, we need to install them in the correct OS.
FROM lambci/lambda:build-nodejs8.10
# General development tools
RUN yum makecache fast
RUN yum -y groupinstall 'Development Tools'
RUN yum -y install gcc-c++ findutils
# Packages needed specifically for compiling Sharp
RUN yum -y install glib2-devel expat-devel libpng-devel libjpeg-turbo-devel zlib-devel giflib-devel libtiff-devel libexif-devel libwebp-devel fftw-devel lcms2-devel
# BMP support is provided by ImageMagick.
RUN yum -y install ImageMagick-devel
@tayfun
tayfun / gist:3259093
Created August 4, 2012 18:09
Closures - Modifying variables closed over
#!/usr/bin/python3.2
def create_counter():
i = 0
def increment():
nonlocal i # this comes with python3; similar to the "global" keyword
i = i + 1
print(i)
return increment
@tayfun
tayfun / JsonExtensions.py
Created January 15, 2012 13:28
Pretty Print Json
"""
Added by tayfunsen to pretty print json strings.
Put this in dist-packages (ex.
/usr/local/lib/python2.7/dist-packages/JsonExtensions.py ) and use prettys to
pretty print json strings.
Ex.
>>> resp.content
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially