This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var csrfToken = $('[name="csrfToken"]').val(); | |
$.getJSON('https://www.linkedin.com/hp/modules/ozfeed/promo/endorsements/fetch?offset=0&count=500', function (response) { | |
var endorsements = response.endorsements; | |
console.log('found ' + endorsements.length + ' endorsements'); | |
function endorse (callback) { | |
var endorsement = endorsements.shift(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.bind = (function(origBind) { | |
return function() { | |
var fn = origBind.apply(this, arguments); | |
fn.__origFn__ = this.__origFn__ || this; | |
return fn; | |
}; | |
}(Function.prototype.bind)); | |
Function.prototype.unbind = function() { | |
return this.__origFn__; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Original source code courtesy John from iOSDeveloperTips.com */ | |
#include <sys/socket.h> | |
#include <sys/sysctl.h> | |
#include <net/if.h> | |
#include <net/if_dl.h> | |
+ (NSString *)getMacAddress | |
{ | |
int mgmtInfoBase[6]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inspired by XRegExp via 2ality | |
* http://www.2ality.com/2012/12/template-strings-xregexp.html | |
* http://xregexp.com/ | |
*/ | |
import test from 'ava'; | |
export function rx(flags) { | |
const trailingComments = /\s+#.*$/gm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
http://mythosil.hatenablog.com/entry/20111017/1318873155 | |
http://blog.dealforest.net/2012/03/ios-android-per-aes-crypt-connection/ | |
*/ | |
@interface NSData (AES) | |
- (NSData *)AES128EncryptedDataWithKey:(NSString *)key; | |
- (NSData *)AES128DecryptedDataWithKey:(NSString *)key; | |
- (NSData *)AES128EncryptedDataWithKey:(NSString *)key iv:(NSString *)iv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mat4 rotationMatrix(vec3 axis, float angle) | |
{ | |
axis = normalize(axis); | |
float s = sin(angle); | |
float c = cos(angle); | |
float oc = 1.0 - c; | |
return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, | |
oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, | |
oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################# | |
# = This script transfers bash history to zsh history | |
# = Change bash and zsh history files, if you don't use defaults | |
# | |
# = Usage: ruby bash_to_zsh_history.rb | |
# | |
# = Author: Ankit Goyal | |
################################################################# | |
# change if you don't use default values |
OlderNewer