Skip to content

Instantly share code, notes, and snippets.

View denvazh's full-sized avatar

Denis Vazhenin denvazh

  • Tokyo
View GitHub Profile
@guumaster
guumaster / 00-README.md
Last active January 23, 2023 15:48
How to upload a file with $.ajax to AWS S3 with a pre-signed url

Upload a file with $.ajax to AWS S3 with a pre-signed url

When you read about how to create and consume a pre-signed url on this guide, everything is really easy. You get your Postman and it works like a charm in the first run.

Then you open your browser, try your usual $.ajax() and send your PUT operation, and you hit the cold iced wall of AWS error message, a simple <Code>SignatureDoesNotMatch</Code> that will steal hours from your productivity.

So here I come to save you and give you a free working example of how to upload a file directly to AWS S3 from your browser. You are wellcome :).

@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@ke4roh
ke4roh / Gemfile
Last active April 2, 2023 10:56 — forked from binarydev/json_utilities.rb
declare module_function
source 'https://rubygems.org'
gem 'json'
group :test do
gem 'minitest'
gem 'test-unit'
end
#!/bin/sh
#
# Downloads and installs the startssl CA certs into the global Java keystore
# on Alpine Linux.
#
# Check if JAVA_HOME is set
[ "$JAVA_HOME" = "" ] && echo "ERROR: JAVA_HOME must be set" && exit 1
# Check if cacerts file is present
@iansltx
iansltx / _safari-iframe-cookie-workaround.md
Last active April 7, 2024 15:44
Safari iframe cookie workaround
@le-doude
le-doude / ManacherAlgorithm.java
Created June 19, 2014 06:49
Solving the problem: Find the longest palindrome in a random character array. Can also be used to find all possible palindromes in the same sequence. http://en.wikipedia.org/wiki/Longest_palindromic_substring
import java.util.Arrays;
/**
* Created by le-doude on 14/06/19.
* <p/>
* Did you know it is possible to find the longest palindrom in a char sequence in O(N) time.
* Here is the solution: Manacher's algorithm.
* http://en.wikipedia.org/wiki/Longest_palindromic_substring
*/
public class ManacherAlgorithm {
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 5, 2024 18:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

#!/usr/bin/env python
from pymarkov import markov
from random import choice
import doctest
import argparse
class Generate:
""" A song generator. Generate takes input (musician, album) and returns
a version of that musician's songs.
@sauloperez
sauloperez / signal_catching.rb
Last active November 11, 2020 11:25
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {
@konklone
konklone / ssl.rules
Last active August 8, 2023 08:39
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {