Skip to content

Instantly share code, notes, and snippets.

View FredericJacobs's full-sized avatar
🔐
Encrypt the Planet 🌍

Frederic Jacobs FredericJacobs

🔐
Encrypt the Planet 🌍
View GitHub Profile
private byte[] generateHash() {
MessageDigest messageDigestInstance = null;
byte[] hash = null;
try {
messageDigestInstance = MessageDigest.getInstance("SHA-1");
DigestInputStream dis = new DigestInputStream(new DataInputStream(
new FileInputStream(this)), messageDigestInstance);
while (dis.read() != -1)
;
@FredericJacobs
FredericJacobs / gist:2905457
Created June 10, 2012 13:01
Storify Press Coverage
Embed Code
<script src="http://storify.com/fredericjacobs/press-collection-movies-io.js?header=false&border=false"></script><noscript>[<a href="http://storify.com/fredericjacobs/press-collection-movies-io" target="_blank">View the story "Press Collection - Movies.io" on Storify</a>]</noscript>
Slideshow Code
<script src="http://storify.com/fredericjacobs/press-collection-movies-io.js?template=slideshow"></script><noscript>[<a href="http://storify.com/fredericjacobs/press-collection-movies-io" target="_blank">View the story "Press Collection - Movies.io" on Storify</a>]</noscript>
If responder isn’t already the first responder, this method first sends a resignFirstResponder message to the object that is the first responder. If that object refuses to resign, it remains the first responder, and this method immediately returns NO. If the current first responder resigns, this method sends a becomeFirstResponder message to responder. If responder does not accept first responder status, the NSWindow object becomes first responder; in this case, the method returns YES even if responder refuses first responder status.
If responder is nil, this method still sends resignFirstResponder to the current first responder. If the current first responder refuses to resign, it remains the first responder and this method immediately returns NO. If the current first responder returns YES from resignFirstResponder, the window is made its own first responder and this method returns YES.
The Application Kit framework uses this method to alter the first responder in response to mouse-down events; you can als
@FredericJacobs
FredericJacobs / gist:3977102
Created October 29, 2012 23:00
Leaked Internal Apple Email about Forstall leaving

Team,

We are in one of the most prolific periods of innovation and new products in Apple’s history. The amazing products that we’ve introduced in September and October – iPhone 5, iOS6, iPad mini, iPad, iMac, MacBook Pro, iPod touch, iPod nano and many of our applications – could only have been created at Apple, and are the direct result of our relentless focus on tightly integrating world-class hardware, software and services.

Today, I am announcing changes that will encourage even more collaboration between our world-class hardware, software and services teams at all levels of our company. As part of these changes, Jony Ive, Bob Mansfield, Eddy Cue, and Craig Federighi will be taking on more responsibilities. I am also announcing that Scott Forstall will be leaving Apple next year and will serve as an advisor to me during the interim. I want to thank Scott for all of his many contributions to Apple over his career.

Jony Ive will provide leadership and direction for Human Interface (HI) across the company

Stephen was a hired gun at my first start-up. His contract started a year before I arrived, but he was long gone before I walked in the door. The story goes that when Stephen started, he found a small, solid team of five engineers, a QA lead, and a project manager. They were slowly and steadily going… nowhere. After two weeks of watching the team’s slug-like pace, Stephen was fed up.

Stephen, a guy we hired as a temporary contractor to tidy up our database layer, grabbed the greenest of engineers, moved into the ping-pong room, and told the engineer, “We are not leaving this room until we can see the application actually work.”

The engineer asked, “What does ‘work’ mean?”

Stephen, “I don’t know, we’ll figure it out when we get there.”

#/bin/bash
# Script that notices you when Mega is available.
WEBPAGE="https://www.mega.co.nz/"
while true
do
if [ "$(curl -s $WEBPAGE )" != "Access Denied" ]
then echo "The wait is over" | say "Time to sign up"
else
@FredericJacobs
FredericJacobs / gist:4949885
Created February 14, 2013 01:14
Why Intel shouldn't fab ARM (from a business perspective)

Apple used to get it's ARM fabbed by Samsung. It wasn't an issue for a while but now that Samsung competes with Apple on the device level (where the profit margins are the highest), Apple doesn't like that. In addition to that, Samsung also got more experience in the process building processors for mobile phones.

Hence, Apple had to find someone else to fab it's ARM chips. They went for TSMC. Why ? Probably because Intel didn't want to fab ARM chips. Why ? Because there is only little business to make there.

If you look at the processor markets, Intel leads the market in terms of fabbing capability. This means that they could easily make smaller ARM chips than the rest of the market. But that would also mean that they would have to pay big part of their profit margins away to ARM.

ARM chips are way more efficient power-wise. Intel is now focussing to make more power efficient x86 chips that they hope to bring to the smartphone market in two years time. But by then ARM will probably

@FredericJacobs
FredericJacobs / gist:4986177
Created February 19, 2013 14:04
iTerm2 Sampling
Sampling process 43998 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling iTerm (pid 43998) every 1 millisecond
Process: iTerm [43998]
Path: /Applications/iTerm.app/Contents/MacOS/iTerm
Load Address: 0x100000000
Identifier: com.googlecode.iterm2
Version: 1.0.0.20120203 (1.0.0.20120203)
Code Type: X86-64 (Native)
Parent Process: launchd [150]
$ rock -v
Parsing...
Use sdk sourced from /Users/fred/Developer/ooc/rock/sdk.use
Use deadlogger sourced from /Users/fred/Developer/ooc/libs/deadlogger/deadlogger.use
Use dye sourced from /Users/fred/Developer/ooc/libs/dye/dye.use
Use sdl2 sourced from /Users/fred/Developer/ooc/libs/ooc-sdl2/sdl2.use
Use stb-image sourced from /Users/fred/Developer/ooc/libs/ooc-stb-image/stb-image.use
Use sdl2-opengl sourced from /Users/fred/Developer/ooc/libs/ooc-sdl2/sdl2-opengl.use
Use math sourced from /Users/fred/Developer/ooc/rock/sdk/math.use
<key>game-state-version</key>
<string>ed8937fe-bd94-4ba5-8e0c-78ec40b39cd7</string>
<key>game-state</key>
<data>H4sIAAAAAAAAA7vU6N5YcvlSY0hjCRDnM1yFML0b8+uhTH+EqDOCGYJQ4IkQ9UCIRiGYAQgFTghRVwQTybBQBNMXwQxCMJHc4IjiBhjTBcEMRjDdEEwkbd4Iw4IRTLAJVxtLL3ck5ydnF2SWFF9tLLt5hFG38QDDVQA7F0GNMQEAAA==</data>