Skip to content

Instantly share code, notes, and snippets.

@AndrewKvalheim
AndrewKvalheim / export-selected-regions.scm
Created September 11, 2012 21:56
GIMP script for automatically saving all selections
;;; Non-interactively save all selected regions as separate files
(define (script-fu-export-selected-regions image drawable)
;; Start
(gimp-image-undo-group-start image)
;; If there are selections
(when (= 0 (car (gimp-selection-is-empty image)))
(let ((number 1) (prefix "") (suffix ""))
;; Construct filename components
(let* ((parts (strbreakup (car (gimp-image-get-filename image)) "."))
@vigo
vigo / ruby-tips.md
Created November 4, 2012 22:50
Ruby Tips

Ruby Tips

Genel

  • Herşey bir Object (Nesne)
  • Her Object BasicObjectden türemiş. (Objective-C NSObject gibi...)
  • Object.methods ile o nesneye ait tüm method'lar
  • Object.methods.inspect string olarak method'lar
  • Mutlaka bir şey geriye döner. Hiçbir şey dönmese nil döner.

Style Guide

@staltz
staltz / introrx.md
Last active November 20, 2024 07:53
The introduction to Reactive Programming you've been missing
@abdullin
abdullin / ddd-in-golang.markdown
Last active October 10, 2023 00:46
DDD in golang

This is my response to an email asking about Domain-Driven Design in golang project.

Thank you for getting in touch. Below you will find my thoughts on how golang works with DDD, changing it. This is merely a perception of how things worked out for us in a single project.

That project has a relatively well-known domain. My colleagues on this project are very knowledgeable, thoughtful and invested in quality design. The story spelled out below is a result of countless hours spent discussing and refining the approach.

Conclusions could be very different, if there was a different project, team or a story-teller.

Short story

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
Security - the elephant in the room. Everyone agrees that it is very important but few takes it seriously. We at RisingStack want you to do it right - this is why we have put together this checklist to help you guide through the must have security checks before your application is enabled to thousands of users/customers.
Most of these items are general and applies to all languages and frameworks not just Node.js - however some of the tools presented are Node.js specific. You should also check our introductory Node.js security blogpost.
Configuration Management
Security HTTP Headers
There are some security-related HTTP headers that your site should set. These headers are:
@emrekgn
emrekgn / isimler
Last active April 26, 2024 13:14
Türkçe İsim Listesi
JALE
ALİ
MAHMUT
MANSUR KÜRŞAD
GAMZE
MİRAÇ
YÜCEL
KUBİLAY
HAYATİ
BEDRİYE MÜGE
@emrekgn
emrekgn / soyisimler
Created December 4, 2015 08:44
Türkçe Soyisim Listesi
ŞEN
KANDEMİR
ÇEVİK
ERKURAN
TÜTEN
ÖZTÜRK
YÜZBAŞIOĞLU
VURAL
YÜCEL
SÖNMEZ
@crizstian
crizstian / cinema.microservices.Dockerfile
Last active April 15, 2020 02:15
Example of Dockerfile for a nodejs app
# the first thing we specify in a Dockerfile is the base image.
# This is essentially bare bones alpine linux with node installed.
FROM node:7.5.0-alpine
# Creates a non-root-user.
RUN addgroup -S nupp && adduser -S -g nupp nupp
# Sets the HOME environment variable.
ENV HOME=/home/nupp