Skip to content

Instantly share code, notes, and snippets.

View MichalRemis's full-sized avatar

Michal Remis MichalRemis

  • NVSK s.r.o.
  • Slovakia
View GitHub Profile
def solution(A):
import math
N = len(A)
fib_maxarg = int(math.sqrt(N)) + 10
def fib(n):
""" Compute nth Fibonacci number """
if not hasattr(fib, 'mem'):
fib.mem = [0]*fib_maxarg
@otobrglez
otobrglez / casting_types.rb
Created March 12, 2015 10:55
unknown OID 705: failed to recognize type of '<field>'. It will be treated as String.
#!/usr/bin/env ruby
# If you get "unknown OID 705: failed to recognize type of '<field>'. It will be treated as String."
# it probably means that type of column could not be identified when retriving records
# Example
User.where("'something' as something")
# Will results in unknown OID. However doing this:
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active November 4, 2024 04:45
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@kinopyo
kinopyo / Gemfile
Last active December 28, 2018 00:23
Make Turbolinks work with DoubleClick for Publishers(alternative of Google Adsense)
gem 'turbolinks'
gem 'jquery-turbolinks'
@Maluen
Maluen / react-navigation-drawer-stack.js
Created September 5, 2018 09:57
React Navigation: combining drawer and stack navigator
const StackNavigator = createStackNavigator({
Home: HomeScreen,
Search: SearchScreen,
Details: DetailsScreen,
Credits: CreditsScreen,
}, {
navigationOptions: {
header: null,
},
});