Skip to content

Instantly share code, notes, and snippets.

View hakanensari's full-sized avatar

Hakan Ensari hakanensari

  • Amsterdam
  • 18:34 (UTC +02:00)
View GitHub Profile
@hakanensari
hakanensari / gist:13515ba153e34c3d7474e42d265a62fb
Last active November 10, 2023 15:00
don't drop packets in country.is
echo "net.netfilter.nf_conntrack_max=524288" > /etc/sysctl.d/10-conntrack-max.conf
echo "net.netfilter.nf_conntrack_tcp_timeout_established=300" > /etc/sysctl.d/10-conntrack-tcp-timeout-established.conf
echo "nf_conntrack" >> /etc/modules
@hakanensari
hakanensari / 01-revenge-and-self-realization.md
Last active January 19, 2023 16:41
A short story by ChatGPT

The woman sat at her desk, pen in hand, a blank sheet of paper before her. She stared at the page, her mind awhirl with thoughts and plans, as she began to write the names of those she intended to kill.

First on the list was a man, a cruel and ruthless dictator who had caused countless deaths and suffering. She had spent years researching his every move, studying his weaknesses, and planning her attack.

Next, she wrote the name of a hairdresser, a woman who had once cut her hair too short and refused to fix it. The woman had never forgotten the slight, and had long dreamed of seeking revenge.

Finally, she wrote the name of a software developer, a man who had created a program that had cost her her job. She had spent months learning to code, mastering the intricacies of the software, and devising a way to shut it down and ruin his career.

As she finished writing the names, she felt a sense of satisfaction and power, knowing that her victims would soon meet their end at her hands. But as she looked at the l

@hakanensari
hakanensari / assyrian-vet-billiard-obsession.md
Last active January 18, 2023 19:58
A short story by ChatGPT

Once there was an Assyrian veterinarian named Peter. He was an expert in his field, but he had a peculiar obsession - collecting billiard balls.

He had started his collection when he was just a child and had inherited his father's billiard table. From that day on, he had become fascinated with the round, glossy orbs. He would spend all of his free time scouring thrift stores, garage sales, and online marketplaces in search of new additions to his collection.

Over the years, Peter had amassed an impressive collection. He had billiard balls of all shapes, sizes, and colors. Some were made of ivory, others of marble, and still others of various types of wood. He had even managed to find a set of gold-plated billiard balls that he kept under lock and key.

Despite his love for his collection, Peter never let it interfere with his work as a veterinarian. He was always there to help animals in need, and his patients loved him for his kind and gentle manner.

One day, however, Peter received a call from a farmer w

{
"Request": {
"IsValid": "True",
"ItemLookupRequest": {
"Condition": "All",
"DeliveryMethod": "Ship",
"IdType": "ASIN",
"MerchantId": "All",
"OfferPage": "1",
"ItemId": "0912383119",
@hakanensari
hakanensari / bm.rb
Created December 15, 2015 23:49
The cost of binding lambdas to context in Ruby
require 'benchmark'
foo = -> {}
_ = BasicObject.new
def _.bar
end
n = 4_000_000
@hakanensari
hakanensari / circle.yml
Created November 16, 2015 23:31 — forked from jonah-williams/circle.yml
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@hakanensari
hakanensari / bleh.coffee
Created November 10, 2014 20:15
capture screenshot from video etc.
$capture = $ ".capture"
$capture.change (event) ->
file = @files[0]
event.preventDefault()
# Capture first frame of video
video = document.createElement("video")
video.src = URL.createObjectURL(file)
video.style.visibility = "hidden"
<Notification>
<NotificationMetaData>
<NotificationType>AnyOfferChanged</NotificationType>
<PayloadVersion>1.0</PayloadVersion>
<UniqueId>14baf090-6a81-4d13-b1ad-340363d569d8</UniqueId>
<PublishTime>2014-02-23T11:35:40.497Z</PublishTime>
<SellerId>MERCHANT_ID_1</SellerId>
<MarketplaceId>A2EUQ1WTGCTBG2</MarketplaceId>
</NotificationMetaData>
<NotificationPayload>
class Hash
def dig(key)
each.find do |k, v|
return v if k == key
v.dig(key) if v.is_a?(Hash)
end
end
end
@hakanensari
hakanensari / promo.sh
Created April 29, 2014 10:42
Pomodoro & Programming, Motherfucker Mashup
#!/bin/bash
for i in {1..4}
do
for ITS in start stop
do
say "$ITS programming, motherfucker."
[[ $ITS = start ]] && sleep 1500 || sleep 300
done
done