Skip to content

Instantly share code, notes, and snippets.

View cameronehrlich's full-sized avatar
💭
Swifting

Cameron Ehrlich cameronehrlich

💭
Swifting
View GitHub Profile
@cameronehrlich
cameronehrlich / MobileSafariUserAgentSwapExample.m
Last active March 25, 2018 12:08
An example of how to get a UIWebView to display a non-mobile version of a GitHub repository by spoofing the UserAgent.
@interface PLViewController ()
@property (strong, nonatomic) IBOutlet UIWebView *webView;
@end
@implementation PLViewController
- (void)viewDidLoad
{
@cameronehrlich
cameronehrlich / AVCaptureSessionSetup.m
Last active February 20, 2017 07:24
Gives an example of how to initialize an video capture session
// MEModel.h
@interface MEModel : NSObject
@property (nonatomic, strong) AVCaptureSession *session;
@property (nonatomic, strong) AVCaptureDevice *frontCamera;
@property (nonatomic, strong) AVCaptureDevice *backCamera;
@property (nonatomic, strong) AVCaptureDeviceInput *inputDevice;
@property (nonatomic, strong) AVCaptureMovieFileOutput *videoFileOutput;
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer; // Once the session is setup, this can just easily be added to any view. i.e. [self.view.layer addSublayer:[[MEModel sharedInstance] previewLayer];
// google_search.js
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var driver = new webdriver.Builder()
.forBrowser('firefox')
.build();
driver.get('http://www.google.com/ncr');

Keybase proof

I hereby claim:

  • I am cameronehrlich on github.
  • I am cameronehrlich (https://keybase.io/cameronehrlich) on keybase.
  • I have a public key ASBuCEMjuh5Qf9eEjBvLOu7nCjW8Iyw66n109hIHZcnXAwo

To claim this, I am signing this object:

@cameronehrlich
cameronehrlich / ComminCrypto.h
Created November 14, 2016 10:13
PHP's M_CRYPT in C Environment
/////////////////////////
// Base64.h
#ifndef BASE64_H
#define BASE64_H
#include <string>
#include <vector>
class Base64
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[super pushViewController:viewController animated:animated];
self.interactivePopGestureRecognizer.delegate = viewController;
self.interactivePopGestureRecognizer.enabled = YES;
}
- (void)popViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[super popViewController:viewController animated:animated];
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j
git log --since="20 days ago" --full-history --simplify-merges --author="cameron" --reverse --oneline > ~/Desktop/commits-for-invoice.txt
@cameronehrlich
cameronehrlich / squash_all.md
Last active October 26, 2017 20:03 — forked from burin/gist:ab156df44fd313bb1b0a
Squashing your commits into one commit without using interactive rebase.
git fetch -ap # get in sync w/ server
BRANCH_NAME=$(git symbolic-ref --short -q HEAD)
git checkout $BRANCH_NAME # switch to the appropriate branch
git reset --hard origin/$BRANCH_NAME # get my branch to be exactly the same as what's on the server
MERGE_BASE=$(git merge-base origin/$BRANCH_NAME origin/master) # get the commit where your branch originates
git reset --mixed $MERGE_BASE # reset to the point where your branch originates, but put your changes like you just made them
git add . # stage your changes for a new commit
# echo "Enter your commit message, followed by [ENTER]:"
# read MESSAGE
Status Code: 200
URL: https://idmsa.apple.com/appleauth/auth
MIME: application/json
Content-Length: 2127
Encoding: utf-8
Filename: auth.json
Cache-Control: no-cache, no-store, no-store
Connection: keep-alive
Content-Encoding: gzip