Google Busts Symantec-Issued Certificates and Its a Big Mess
Google said it would begin withdrawing trust from web sites with certificates issued by Symantec Corp. In-brief: Google’s rebuke of Symantec over its sloppy and problem-plagued certificate authority business risks upsetting some of the Internet’s biggest brands. (more…)
View On WordPress
Report: Hacking Crews are all APT now
The tactics of cyber criminal hacking crews are indistinguishable from those of sophisticated, state sponsored “advanced persistent threat” groups, the firm FireEye said in its most recent M-Trends report. In-brief:The tactics of cyber criminal hacking crews are indistinguishable from those of sophisticated, state sponsored “advanced persistent threat” groups, the firm FireEye said in its most…
View On WordPress
me: why haven't i bought this game yet
me: oh right i forgot i need money to purchase goods and services
*5 minutes pass*
me:
me:
me:
me: why haven't i bought this game yet
The Publish/Subscribe pattern is one of the most used patterns in software, especially in User Interfaces with JavaScript. It is used whenever 2 pieces of a system need to communicate, but cannot or should not communicate directly. For example, a system receives data from a server at regular intervals that a bunch of components can use (which are added while the system runs):
var Publisher = function() { var self = { subscribers: [] }; self.subscribe = function(callback) { self.subscribers.push(callback); }; self.publish = function(data) { self.subscribers.forEach(function(callback) { callback(data); }); }; return self; } var publisher = Publisher(); // Simulate a set of data being returned over time var serverStream = function(callback) { Array.apply(null, { length: 5 }).forEach(function(unused, index) { var ms = index * 500 setTimeout(function() { callback('data-piece: ' + ms + ' ms'); }, ms); }); }; serverStream(publisher.publish); // Simulate components being registered over time. publisher.subscribe(function(data) { console.info('subscribe from part 1', data); }); setTimeout(function() { publisher.subscribe(function(data) { console.info('subscribe from part 2', data); }); }, 1000) // subscribe from part 1 data-piece: 0 ms // subscribe from part 1 data-piece: 500 ms // subscribe from part 1 data-piece: 1000 ms // subscribe from part 1 data-piece: 1500 ms // subscribe from part 2 data-piece: 1500 ms // subscribe from part 1 data-piece: 2000 ms // subscribe from part 2 data-piece: 2000 ms
The problem is that same pattern with almost identical code will be written over and over again in the same project. So instead of creating a publisher and subscriber with multiple message types each time this pattern needs to be used, it is simpler to just use new instances of the publisher object each time:
var messageSet1 = function(callback) { Array.apply(null, { length: 3 }).forEach(function(unused, index) { setTimeout(function() { callback('Hello ' + index); }, index * 500); }); }; var messageSet2 = function(callback) { Array.apply(null, { length: 3 }).forEach(function(unused, index) { setTimeout(function() { callback('World ' + index); }, index * 500); }); }; var MessageBox = function() { var self = { publishers: [] }; self.streams = function(streams) { self.publishers = []; streams.forEach(function(stream, index) { self.publishers.push(Publisher()); stream(self.publishers[index].publish); }); }; self.subscribeTo = function(index, callback) { return self.publishers[index].subscribe(callback); } return self; }; var messageBox = MessageBox(); // Use a trivial example to preserve clarity messageBox.streams([messageSet1, messageSet2]); messageBox.subscribeTo(0, function(data) { console.info('subscribe from part 1B', data); }); messageBox.subscribeTo(1, function(data) { console.info('subscribe from part 2B', data); }); // subscribe from part 1B Hello 0 // subscribe from part 2B World 0 // subscribe from part 1B Hello 1 // subscribe from part 2B World 1 // subscribe from part 1B Hello 2 // subscribe from part 2B World 2
A non-index based naming scheme could be introduced by passing more data into the streams call, but I wanted to keep the example as minimal as possible.
Github Location: https://github.com/Jacob-Friesen/obscurejs/blob/master/2016/publishSubscribeAutomation.js
So at work today I worked with a new server and she told me and the other servers how much she loved me and how good of a worker I am and that I’d make an amazing server and omg its so nice to see people appreciate my work. My manager thanked me for coming in and doing my job and above and beyond and I was just like “dude I’m just working” lol and he’s like nah you do more than that and I’m just glad they liked my work ethic and that I get a serving job cause that pays more, a lot more. AND it’s a good job until I can do acting full time =‘) and a lot of servers tell me they love me and appreciate me <3 WHICH IS AMAZING CAUSE THEY WILL TIP ME WELL !!!
Quick scroll, like, and view notes of a post on your dashboard: Keys J, K, L and N come very handy. Hit J for next post, K for previous post, L to like a post and N to show post’s notes
Quickly compose a new post from anywhere on your Dashboard: key combo Z + C (Option + Z for Mac)
Quickly reblog a post: Shift + R (Not working? Make sure you are on the right post by pressing J or K)
Quickly add a post to your Queue: Shift + E
Quickly play a video: Just click Enter
Quickly switch between your Dashboard and your Blogs: key combo Z+ Tab
The thing about programming is that your work is never done, because you’ll never be satisfied with the code you wrote last year.
(via thethingaboutprogramming)
me_irl
{Foods of the Sunnah}
There is a surah in the Quran, At-Tin, named after this sweet fruit.
Abu Dharr said, “The Prophet (peace and blessings of Allah be upon him) was given a basket full of figs as a present. He said to us, "Eat!”. He ate of it and said: “If I could say that a fruit was sent down from Heaven, it would be this, as the fruit in Heaven has no stones. Eat it, as it cures hemorrhoids and it is useful for treating gout (arthritis).” [x]
Figs contain substances which promote lactation for mothers who want to breast feed their babies. They also aid in the reduction of risk for breast cancer for some women. Figs are very useful in treating hemorrhoids, as the Prophet (peace and blessings of Allah be upon him) mentioned, gout/arthritis, as the Prophet (peace and blessings of Allah be upon him) mentioned, inflammation, and menstrual disturbances. Figs essentially are one of the most useful foods found in nature having over 50 uses medicinally. (x)