Posts

javascript - Issue Copying Code From JSFiddle -

i trying copy code jsfiddle, it's radial loading bar. wanted put html/css files , mess code, can't seem work. shows blank, not displaying anything. jsfiddle link http://jsfiddle.net/andsens/d7vkd/ . :) here exact copy of html/javascript put html document: <html> <link rel="stylesheet" type="text/css" href="loadercss.css"> <head> <script src="jquery.js"></script> <script type="text/javascript"> $('head style[type="text/css"]').attr('type', 'text/less'); less.refreshstyles(); window.randomize = function() { $('.radial-progress').attr('data-progress', math.floor(math.random() * 100)); } settimeout(window.randomize, 200); $('.radial-progress').click(window.randomize); </script> </head> <body> <div class="radial-progress" data-progress="0"> <div class="circle"> ...

html - Stacking divs side by side -

i'm trying stack these divs side side - left , right. right stack of divs won't clear. should float left stack left , same right stack or left , right floats? i'm trying emulate this, i'm trying make table divs. http://www.weareint.io/ demo https://jsfiddle.net/zeegn9cn/ * { padding: 0px; margin: 0px; } #sections { /*--left section columns--*/ width: 1000px; height: 400px; margin: 0 auto; background: red; } .sectionlfirst { width: 500px; background: orange; } .sectionlsecond { width: 500px; background: skyblue; } .sectionlthird { width: 500px; background: indigo; clear: both; } .sectionrfirst { /*--right section columns--*/ float: right; width: 500px; background: orange; clear: both; } .sectionrsecond { float: right; width: 500px; background: skyblue; clear: both; } .sectionrthird { float: right; width: 500px; background...

shell - Assign BASH variable from file with specific criteria -

a config file last line contains data want assign right of = sign variable can display , call later in script. example: /path/to/magic.conf : foo bar thisoption=foo.bar.address:location.555 what best method in bash shell script read last line of file , assign right of equal sign? in case, foo.bar.address:location.555 . the last line has want target , there ever single = sign in file happens last line. google , searching here yielded many close non-relative results using sed/awk couldn't come i'm looking for. use sed : variable=$(sed -n 's/^thisoption=//p' /path/to/magic.conf) echo "the option is: $variable") this works finding , removing thisoption= marker @ start of line, , p rinting result.

momentjs - Why the UTC offsets available in moment-timezone are not exactly the same as Wikipedia UTC list -

i converting visitors local times utc using momentjs visitor_utc = moment().utc().valueof() and getting offset visitor_utc_offset = moment().utcoffset().valueof() / 60 i have drop-down list filled offsets (... -01:00, +00:00, +01:00, +02:00 ....) user can change , set actual offset. default selected value visitor_utc_offset is there method list of offsets using momentjs ? with moment-timezone it's possible : for element in moment.tz.names() console.log moment.tz(element).format("z") but gives long list redundant values (because formatting timezones names can have same offset) i found list in wikipedia list_of_utc_time_offsets not sure if it's complete list, , it's reliable future ? update to compare list of offsets used in moment-timezone , 1 wikipedia used code : element in moment.tz.names() if $.inarray( moment.tz(element).format("z"), arr ) <= -1 arr.push moment.tz(element).format("z") which...

updating embedded array in MongoDB -

i trying update embedded array document in collection structure { id: 1, fields:[ { "lang" : "eng","embeddedarray" : ["a","b","c"] }, { "lang" : "abcd","embeddedarray" :["a","d","e"] }] } i want update in embeddedarray try update using query updating entire array 'a' instead of ['a','b','c'] db.collectionname.update({"fields.embeddedarray" : 'a'}, {"$set" : {"fields.$.embeddedarray" : "a"}}); is way update without loosing other elements in array ? please check below query : db.collectionname.find({"fields":{$elemmatch: {"lang":"a"}}}).foreach(function(doc){ ...

git - Pull a commit into another branch exactly (without merging) -

i have structure similar below: c1 -- c2 -- c3 \ -- c4 i want pull c3 on on top of c4 . ( nb: c3 & c3a hold save files ) c1 -- c2 -- c3 \ -- c4 -- c3a if try merge or pull told date. how can force 're-merge' can c3 on top? in current branch, don't think can since c3 merged in branch. you can try cherry-picking commits on new branch though, should give desired results: first, create new branch: git checkout -b new_branch <c1> now cherry pick c4 on new_branch: git cherry-pick c4 now cherry pick c# on new_branch: git cherry-pick c3 the above should give desired results in new_branch : c1 -- c2 -- c3 \-- c4 -- c3

iOS Push Notification inside proprietary framework -

i need distribute framework. this frameworks needs silent notifications update configuration in background. for understanding seems not possible because push configuration setup done on application level. (and in case, not manage application push certificate) is there solution push notification framework ?