Skip to content

Instantly share code, notes, and snippets.

View icodeforlove's full-sized avatar
:octocat:
Indefinitely In Bangkok

Chad icodeforlove

:octocat:
Indefinitely In Bangkok
View GitHub Profile
@taonico
taonico / SafariCookiesArc.m
Created July 24, 2012 05:09
Safari Cookies Cookies.binarycookies (ARC)
//clang -fobjc-arc -framework Foundation -o safari-cookies SafariCookiesArc.m
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
@autoreleasepool {
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *c in [cookieStorage cookies])
{
@icodeforlove
icodeforlove / MacIEParallelsVMs.md
Created February 18, 2016 12:18
Get all Mac IE Parallels VM's
@icodeforlove
icodeforlove / linkedin-auto-endorser.js
Last active May 15, 2016 04:23
Endorse everyone on linkedin
(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();
@cowboy
cowboy / unbind.js
Last active June 20, 2018 19:59
JavaScript: Function.prototype.unbind (for @jugglinmike)
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__;
@Coeur
Coeur / Get iOS MAC address.m
Created November 30, 2011 17:11
Get iOS MAC address #
/* 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];
@shannonmoeller
shannonmoeller / multiline-regexp.js
Last active April 12, 2021 22:16
Multiline Regular Expressions using ES6 Template Strings
/**
* 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;
@matsuda
matsuda / NSData+AES.h
Created February 25, 2014 07:14
Objective-C code for encrypt and decrypt by AES-128 encryption.
/**
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;
@neilmendoza
neilmendoza / gist:4512992
Last active June 9, 2023 14:22
Function to return matrix for rotation about an arbitrary axis in GLSL.
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,
@citrusui
citrusui / fancybutton.md
Last active June 13, 2023 17:58
How to add a fancy Direct Message button to your Tweets https://twitter.com/citrusui/status/719279185123012609

How to add a fancy Direct Message button to your Tweets

Step 1: Go to tweeterid.com and enter your username.

Step 2: Copy your user ID from the previous website.

Step 3: Copy the following URL:

@goyalankit
goyalankit / bash_to_zsh_history.rb
Last active October 28, 2023 05:07
Import bash history to zsh history.
#################################################################
# = 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