Skip to content

Instantly share code, notes, and snippets.

View ismailunal's full-sized avatar
👋
Say hello!

Ismail UNAL ismailunal

👋
Say hello!
View GitHub Profile
@carolineschnapp
carolineschnapp / related-products.liquid
Last active December 22, 2022 21:29
Related Products — to add to product.liquid
@SeanJA
SeanJA / GIFEncoder.class.php
Last active November 8, 2021 17:39
dynamic animated gif clock
<?php
/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Formerly known as:::
:: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu
::
:: This class is a rewritten 'GifMerge.class.php' version.
::
:: Modification:
@prakhar1989
prakhar1989 / richhickey.md
Last active November 8, 2023 17:19 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@djinn
djinn / Shopify.Oauth.ex
Last active January 21, 2017 21:00
Shopify Oauth strategy for Elixir
defmodule Shopify.Oauth do
@moduledoc """
An OAuth2 strategy for Shopify.
Based on the OAuth2 strategy for GitHub by Sonny Scroggin
in https://github.com/scrogson/oauth2_example
"""
use OAuth2.Strategy
alias OAuth2.Strategy.AuthCode
alias OAuth2.Request
@bennylope
bennylope / ffmpeg-watermark.md
Created April 22, 2016 23:17 — forked from webkader/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@mgwidmann
mgwidmann / twitter_stream.ex
Last active May 28, 2024 08:28
Infinite Streams with Elixir
# Elixir has lazily evaluated enumerable objects that allow you
# to work with enumerable objects like lists either only as needed
# or infinitely.
# Start up iex to play around
$ iex
# Typical enumeration is done eagerly where the result is computed ASAP
iex> Enum.map(1..10, fn i -> i * 2 end)
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
@yurivish
yurivish / venn-diagrams.js
Last active December 26, 2020 03:20
Area-proportional Venn Diagrams
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
@alvises
alvises / app.ex
Last active March 14, 2018 09:15
GenStage and twitter stream
defmodule Twitter do
def start(_type, _args) do
import Supervisor.Spec
workers = [
worker(Twitter.Producer, ["#Rio2016"]),
worker(Twitter.Consumer, [], id: 1),
worker(Twitter.Consumer, [], id: 2),
worker(Twitter.Consumer, [], id: 3)
@PragTob
PragTob / matching.exs
Last active July 28, 2017 08:14
Elixir Pattern matching
defmodule Patterns do
def greet(%{name: name, age: age}) do
IO.puts "Hi there #{name}, what's up at #{age}?"
end
def greet(%{name: "José Valim"}) do
IO.puts "Hi José, thanks for elixir! <3"
end
def greet(%{name: name}) do
IO.puts "Hi there #{name}"
end
mp3_byte_size = (byte_size(binary) - 128)
<< _ :: binary-size(mp3_byte_size), id3_tag :: binary >> = binary
<< "TAG",
title :: binary-size(30),
artist :: binary-size(30),
album :: binary-size(30),
year :: binary-size(4),
comment :: binary-size(30),
_rest :: binary >> = id3_tag