Posts

ruby - How can I use private gems(GemFury) in a docker container? -

i'm trying run ruby scripts automating exports. since these run remotely build them in docker container , push them iron worker. we use gemfury hosting essential private gems these scripts. keep credentials gemfury out of git use global bundle config bundle config gem.fury.io my_secret_token . how can set config bundle pull in gems gemfury without having them show in source control? set global bundle config property application specific property. push changes public repository. update secret_token value in bundle-config file ( $app_dir/.bundle/config ) , run $ git update-index --assume-unchanged <file> command remove file git tracking , prevent updating actual secret_token value in public repository. $ bundle config --local gem.fury.io secret_token $ git commit -a -m "adding application bundle config properties" $ git push origin master $ bundle config --local gem.fury.io d1320f07ac50d1033e8ef5fbd56adf360ec103b2 $ git update-index --assume-unch...

javascript - How to detect changes with Date objects in Angular2? -

date objects modified using setdate method arent getting updated in template. in template: <p>{{date | date:'mediumdate'}}</p> in component: nextday(){ this.date.setdate(this.date.getdate()+1); } but when call nextday function, template isnt updated new value. the way change detection working doing this: nextday(){ var tomorrow = new date(); tomorrow.setdate(this.date.getdate()+1); this.date = tomorrow; } are there better way accomplish same task? i think right way, change reference of date variable. docs here have: the default change detection algorithm looks differences comparing bound-property values reference across change detection runs. so if date reference remains same, nothing happen. need new date reference , that's why second version of nextday() works. if remove formatting pipe see still second version of nextday() works.

Facebook PHP Sdk return redirect uri is required -

Image
i trying authenticate using facebook php sdk returning error the parameter redirect_uri required you can see in url above redirect_uri present value. here code using config.php <?php //configure app here define("app_id","abcd");//replace facebook app id define("app_secret","abcd");//replace facebook app secret define("callback_uri","https://example.com/callback.php");//replace callback url [this facebook redirect user after login] define("logout_redirect_url","https://example.com/close.php");//replace url of login page /** app configuration end here **/ //no need change below require_once('facebook-php-sdk-v4-5.0.0/src/facebook/autoload.php');//loads facebook sdk session_start(); $fb = new facebook\facebook([ 'app_id' => app_id, 'app_secret' => app_secret, 'default_graph_version' => 'v2.5', ]); ?> login.php ...

How to find an index of clicked tab in QTabWidget in Python QT? -

i developing simple text editor has mutlitabs. want implement rightclick menu rename clicked (not current) tab of qtabwidget instance. have find index of clicked tab. how can this? from pyqt4.qtcore import * pyqt4.qtgui import * class myapplication(...): ... def contextmenuevent(self, event): tabindex = ... # <- should type here? menu = qmenu(self) renameaction = menu.addaction("rename") action = menu.exec_(self.maptoglobal(event.pos())) if action == renameaction: self.renametabslot(tabindex) def renametabslot(self, tabindex): ... you need check clicked position (i.e. event.pos () ) against tab regions manually. python bit rusty, here's c++ code instead. assuming tabwidget called mytabwidget : int tabindex = -1; { qtabbar* tabbar = mytabwidget->tabbar (); qpoint globalpos = ->maptoglobal (event->pos ()); qpoint posintabbar = tabbar->mapfromglobal (g...

html - -moz-appearance notwork properly in radio button -

Image
i have dropdown radio button: and when clicked dropdown change this: but in mozilla don´t change not style have: my css this(only put 1 style cause same rest of element); when clicked dropdown: li:first-child input[type='radio']{ -webkit-appearance:none; -moz-appearance: none; width:15px; height:15px; border:3px solid #6a706d; border-radius:50%; outline:none; margin: 0 13px -3px 0; /*box-shadow:0 0 5px 0px #6a706d inset;*/ } and when appear in dropdown: .status-1{ -webkit-appearance:none; -moz-appearance: none; width:12px; height:12px; border:3px solid #6a706d; border-radius:50%; outline:none; margin: 0 13px -3px 0; } here mi fiddle allright, got it. not element can change firefox. way this, fake this: fiddle there have been previous questions on stackoverflow this. check link

python - Getting values from all the indices of a list (Determining Prime Numbers) -

first , foremost i'm new python. trying determine if number, let's 167 prime number using modulo operation, % . e.g., let 167 % n = value i when 167 % 1 , 167 % 167 , should return 0 , n in range(2,166) , should giving remainder of 167 % n . problem have trying print remainder when 167 % n n = 1 ~ 167 don't know how values (which should remainder) of indices of list. so, here's have: l = [] #creates empty list i=0 #initialize i? in range(1, 168) : if 167 % == 0 : print ("there no remainder") else : 167 % == x # x should value of remainder l[i].append(x) #attempting add x ... indices of list. print(l[x]) #print values of x. it's better if can use while loop, should clearer. so, while i iterates 1-167, should adding results x indices of list , want print results. any recommendation guys? appreciated!! bunch. this creates list of remainders not equal zero: l = [] in range(1, 168) : remainder ...

c++ - Compiling libzip on Mac: Undefined symbols for architecture x86_64 -

i've been learning c++ , have decided try create simple file reader using libzip on archive files (e.g. word). i’ve installed libzip on macbook using brew seem keep on getting following issue whenever try compile program uses libzip: undefined symbols architecture x86_64: "_zip_fopen", referenced from: _main in main-918bfa.o "_zip_open", referenced from: _main in main-918bfa.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) make: *** [a.exe] error 1 the command use compile: g++ -g main.cpp -std=c++11 -i/usr/local/cellar/libzip/0.11.2/include -i/usr/local/cellar/libzip/0.11.2/lib/libzip/include -l/usr/local/cellar/libzip/0.11.2/lib -o ../a.exe main.cpp: #include <iostream> #include <fstream> #include <zip.h> #include <zlib.h> using namespace std; int numargs = 2; int main(int argc, char** argv){ // parse command line arguments ...