Skip to content

Instantly share code, notes, and snippets.

View gingray's full-sized avatar
🎯
Focusing

Ivan gingray

🎯
Focusing
View GitHub Profile
@gingray
gingray / __why-and-how-to-use.md
Created January 3, 2022 18:15 — forked from passcod/__why-and-how-to-use.md
Bootstrap 4 mixins for spacing utilities without classes

Why?

This:

.action {
  @extend .ml-3;
}
@gingray
gingray / chatmorgul.rb
Created July 15, 2021 08:35
chatmorgul
require 'json'
require 'set'
require 'date'
class Event
attr_reader :event_name, :date
def initialize(event_name, date)
@event_name = event_name
@date = date
@gingray
gingray / patch_apk_for_sniffing.md
Created January 17, 2021 13:43 — forked from unoexperto/patch_apk_for_sniffing.md
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d net.flixster.android-9.1.3@APK4Fun.com.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
@gingray
gingray / gist:ab2e9a6376aa6ccb516354c2bee74ab6
Created June 17, 2020 10:03 — forked from happyrobots/gist:1862963
Copy to Clipboard Using Ruby
# Mac
IO.popen('pbcopy', 'r+') { |clipboard| clipboard.puts html_out }
# Linux
IO.popen(’xsel –clipboard –input’, ‘r+’) { |clipboard| clipboard.puts html_out }
@gingray
gingray / music_random_things.md
Last active May 1, 2020 12:03
Random thinngs about music

440 * 2^((n - 69)/12) n - note from 0 to 127 69 - this A4 midi key to frequency equal tuning is A4(440hz) (I absolutlely don't knwo what is base tuning is)

@gingray
gingray / aws_s3_test.rb
Created March 25, 2020 16:08
Ruby script to test AWS S3
#!/usr/bin/ruby
require 'rubygems'
require 'yaml'
require 'aws-sdk-s3'
access_key=""
secret_access_key=""
region=""
@gingray
gingray / p4merge4git.md
Last active March 9, 2020 16:51 — forked from tony4d/p4merge4git.md
Setup p4merge as a visual diff and merge tool for git
@gingray
gingray / howto.md
Created December 4, 2019 15:17 — forked from rafaelcaricio/howto.md
Using git bisect

Using git bisect

Git provides a simple way to find out where some code was modified or removed from your codebase. You can use git bisect for that and the processes can be completely automated.

As example I will try to find out when the method send_email_notification was removed from the file app/models/person.rb. So you have to create a automated bash file, or other kind of script, that should return 0 when the method is found and 1 otherwise. So git can run this script for each commit until it returns 1, which means that the method was removed in that commit. There's the script we gonna use:

if [[ `cat app/models/person.rb | grep send_email_notification` ]]; then
@gingray
gingray / git_bisect_examle.md
Last active December 4, 2019 15:14
git bisect example
git bisect start
git bisect good 60caac5
git bisect bad fba59ff34722b9b4ee0bcd6c0f9a1873f57345d4
git bisect run ruby check.rb
if File.open('/Users/gingray/github/ideavim/resources/META-INF/plugin.xml').read() =~ /VimWindowClose/
 exit(0)
@gingray
gingray / rails_init.md
Last active February 9, 2020 18:17
Rails new options
rails new test-angular --database=postgresql -T --webpack=angular
rails new test-angular --database=postgresql -T --webpack=react