This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function triggerKeyboardEvent(el, keyCode, type) | |
| { | |
| var eventObj = document.createEventObject ? | |
| document.createEventObject() : document.createEvent("Events"); | |
| if(eventObj.initEvent){ | |
| eventObj.initEvent(type, true, true); | |
| } | |
| eventObj.keyCode = keyCode; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module PaginationHelper | |
| def paginate(current, max, template, delta: 2) | |
| left = current - delta | |
| right = current + delta + 1 | |
| range = [] | |
| range_with_dots = [] | |
| l = nil | |
| max.times do |_i| | |
| i = _i + 1 | |
| if i == 1 || i == max || i >= left && i < right |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.pm.ResolveInfo; | |
| import android.content.res.AssetFileDescriptor; | |
| import android.database.Cursor; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.graphics.Matrix; | |
| import android.media.ExifInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generate PDFs from the Markdown source files | |
| # | |
| # In order to use this makefile, you need some tools: | |
| # - GNU make | |
| # - Pandoc | |
| # - LuaLaTeX | |
| # - DejaVu Sans fonts | |
| # Directory containing source (Markdown) files | |
| source := src |