Skip to content

Instantly share code, notes, and snippets.

View toropanov's full-sized avatar
👋

Anton Toropanov toropanov

👋
View GitHub Profile
@toropanov
toropanov / Protype.js
Last active August 29, 2015 14:15
Working with Objects
function Class(){/*тут инициализируем поля *}
Class.prototype = {/*Методы*/}
@toropanov
toropanov / gist:250d3f361a54bb2c6d80
Created May 12, 2015 16:02
Observe objects for changes
class ObjectObserver extends Eventual
constructor: (@_object)->
super
@events_list = ['update']
Object.defineProperty this, 'value', {
get: -> @_object
set: (new_value)->
unless @object_compare(@_object, new_value)
old_value = $.extend({}, @_object)
@_object = $.extend(true, @_object, new_value)
$('.sortable').sortable().bind 'sortupdate', ->
$(el_item).each (i, el)->
cur_index = $(el_item).index(el)
el_inputs = $(el).find('input[name]')
el_inputs.each (index, input)->
original_name = $(input).attr('name')
changed_name = original_name.replace(/\[(\d+)\]/, "[#{cur_index}]")
$(input).attr('name', changed_name)
const {config:c} = this.props
// $(document).on 'click', (e)=>
// el_widget = jq('.bprices_widget')
// is_widget = el_widget.is(e.target)
// is_inside = jq.contains(el_widget[0], e.target)
// unless is_widget || is_inside
// @elem('.bprices_widget_head_countries').removeClass('opened')
Generate APK (UNSIGNED) (Android)
Create the folder assets in android/app/src/main folder.
Run curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
Run react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Run cd android && ./gradlew assembleRelease
docker volume rm leveltravel_redis-store
{
"workbench.colorTheme": "Atom One Dark",
"workbench.iconTheme": null,
"workbench.statusBar.feedback.visible": false,
"gitProjectManager.baseProjectsFolders": [
"/Users/tanotify/Projects"
],
"gitProjectManager.ignoredFolders": ["node_modules"],
"gitProjectManager.maxDepthRecursion": 2,
"workbench.startupEditor": "newUntitledFile",
function getFullPost(){
return await Promise.all([
fetch('/post'),
fetch('/comments')
]);
}
const [post, comments] = await getFullPost();