Skip to content

Instantly share code, notes, and snippets.

View veelenga's full-sized avatar
🇺🇦
Annihilating code

Vitalii Elenhaupt veelenga

🇺🇦
Annihilating code
View GitHub Profile
@mnishiguchi
mnishiguchi / rails_friendly_forwarding.md
Last active April 29, 2024 13:25
Rails, Devise - Friendly forwarding after sign in or log in
@gilbertw1
gilbertw1 / keybinds.el
Last active July 5, 2017 07:33
spacemacs keybinds
(evil-define-operator evil-delete-char-without-register (beg end type reg)
"delete character without yanking unless in visual mode"
:motion evil-forward-char
(interactive "<R><y>")
(if (evil-visual-state-p)
(evil-delete beg end type reg)
(evil-delete beg end type ?_)))
(evil-define-operator evil-delete-backward-char-without-register (beg end type reg)
"delete backward character without yanking"
@kirkchris
kirkchris / CloudFrontRemoteIp.rb
Created April 13, 2016 15:20
Rails 4 Middleware which extends RemoteIp to provide the correct IP for distributions which are deployed as origins to CloudFront
# Note: This code changes in rails 5, so make sure we update before then!
# Written by Chris Kirk at Primer (https://goprimer.com)
class CloudFrontRemoteIp < ActionDispatch::RemoteIp
def call(env)
env["action_dispatch.remote_ip"] = CloudFrontGetIp.new(env, self)
@app.call(env)
end
@yang-wei
yang-wei / destructuring.md
Last active December 2, 2024 06:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@shiroyasha
shiroyasha / dog.rb
Created February 16, 2016 22:20
Method tracer for Ruby classes
class Dog
attr_writer :name
def initialize(name)
@name = name
end
def bark
puts "patrick"
end
@bensie
bensie / imagemagick.bash
Last active June 24, 2024 12:21
ImageMagick Static Binaries for AWS Lambda
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at:
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html
#
# As of May 21, 2019, this is:
# Amazon Linux AMI 2018.03.0 (ami-0756fbca465a59a30)
#
# You need to prepend PATH with the folder containing these binaries in your Lambda function
# to ensure these newer binaries are used.
@keplersj
keplersj / logged.rs
Created July 25, 2015 21:00
Gist demonstrating the ability to run Crystal code from Rust.
#[link(name = "logger")]
extern {
fn CrystalLog(text: *const u8);
}
fn log(text: &'static str) {
unsafe{ CrystalLog(text.as_bytes().as_ptr()) };
}
fn main() {
@BinaryMuse
BinaryMuse / README.md
Last active April 20, 2022 21:45
Elixir Map/HashDict Performance on Erlang OTP R17 vs R18
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373