Skip to content

Instantly share code, notes, and snippets.

View ZilvinasKucinskas's full-sized avatar
:octocat:
Trust Me, I’am Software Engineer

Zilvinas Kucinskas ZilvinasKucinskas

:octocat:
Trust Me, I’am Software Engineer
View GitHub Profile
@ZilvinasKucinskas
ZilvinasKucinskas / ci.yml
Created October 17, 2022 08:35
Github Action with PG, MySQL, SQLite
name: Tests
on:
pull_request:
branches:
- '*'
push:
branches:
- master
jobs:
@ZilvinasKucinskas
ZilvinasKucinskas / key.md
Created February 28, 2019 00:10
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@ZilvinasKucinskas
ZilvinasKucinskas / rquine.rb
Created September 20, 2018 15:24
rquine.rb
eval=eval=eval='eval$s=%q(eval(%w(puts((%q(eval=ev
al=eval=^Z^##^_/#{eval@eval@if@eval)+?@*10+%(.size
>#{(s=%(eval$s=%q(#$s)#)).size-1}}}#LMNOPQRS_##thx
.flagitious!## )+?@*12+%(TUVW XY/.i@rescue##
/_3141592653 589793+)+?@* 16+%(+271828
182845904; _987654321 0;;eval)+?
@*18+%("x =((#{s.s um}-eval.
_sum)%256 ).chr; ;eval)+?@
*12+%(.s can(//){ a=$`+x+$
^_a.unpa ck (^ H*^)[0].
@ZilvinasKucinskas
ZilvinasKucinskas / bitcoin-pay.rb
Created June 5, 2018 19:01 — forked from Sjors/bitcoin-pay.rb
This script demonstrates how a bitcoin transaction is created and signed. Just pass in your own address and private key and it will prepare a transaction for you. You can then copy & paste that transaction into a webservice like Blockchain to send it. I wrote this mostly to understand better how it works. I sometimes had to "cheat" and look at t…
#!/usr/bin/env ruby
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'pry'
require 'bigdecimal'
require 'bitcoin' # Because I need to cheat every now and then
# Usage:
# gem install pry json ffi ruby-bitcoin
@ZilvinasKucinskas
ZilvinasKucinskas / facebook.rb
Created May 9, 2018 11:47 — forked from a14m/facebook.rb
Gist for manually OAuth2 facebook for Rails APIs
# lib/omniauth/facebook.rb
require 'httparty'
module Omniauth
class Facebook
include HTTParty
# The base uri for facebook graph API
base_uri 'https://graph.facebook.com/v2.3'
@ZilvinasKucinskas
ZilvinasKucinskas / Gemfile
Created April 25, 2018 13:01 — forked from goncalvesjoao/Gemfile
Changes you need to make in order to make Devise use JWT Header Authentication
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile"
gem 'jwt'
@ZilvinasKucinskas
ZilvinasKucinskas / javascript_interview_questions.txt
Last active January 25, 2017 13:56
Awesome Javascript interview questions
1. Event delegation
We have html code:
<ul id="todo-app">
<li class="item">Walk the dog</li>
<li class="item">Pay bills</li>
<li class="item">Make dinner</li>
<li class="item">Code for one hour</li>
</ul>
@ZilvinasKucinskas
ZilvinasKucinskas / introrx.md
Created October 11, 2016 08:18 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@ZilvinasKucinskas
ZilvinasKucinskas / git-feature-workflow.md
Created March 22, 2016 14:09 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.