Skip to content

Instantly share code, notes, and snippets.

@mihai-salari
mihai-salari / script.js
Created July 17, 2018 15:24 — forked from acoyfellow/script.js
XHR IG login
var params = "username=username&password=password";
new Promise(function (resolve, reject) {
var http = new XMLHttpRequest();
http.open("POST", "https://www.instagram.com/accounts/login/ajax/", true);
http.setRequestHeader('x-csrftoken', window._sharedData.config.csrf_token);
http.setRequestHeader('x-instagram-ajax', '1');
http.setRequestHeader('x-requested-with', 'XMLHttpRequest');
http.setRequestHeader("pragma", "no-cache");
http.setRequestHeader("cache-control", "no-cache");
@mihai-salari
mihai-salari / script.js
Created July 17, 2018 15:24 — forked from acoyfellow/script.js
XHR IG login
var params = "username=username&password=password";
new Promise(function (resolve, reject) {
var http = new XMLHttpRequest();
http.open("POST", "https://www.instagram.com/accounts/login/ajax/", true);
http.setRequestHeader('x-csrftoken', window._sharedData.config.csrf_token);
http.setRequestHeader('x-instagram-ajax', '1');
http.setRequestHeader('x-requested-with', 'XMLHttpRequest');
http.setRequestHeader("pragma", "no-cache");
http.setRequestHeader("cache-control", "no-cache");
@mihai-salari
mihai-salari / install-php7.2-mcrypt.sh
Created July 5, 2018 17:59 — forked from arzzen/install-php7.2-mcrypt.sh
Install PHP 7.2 MCrypt extension
## How to install mcrypt in php7.2
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
##
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php
@mihai-salari
mihai-salari / ubuntu-server.md
Created July 5, 2018 17:51 — forked from isogram/ubuntu-server.md
Setup ubuntu server from scratch

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@mihai-salari
mihai-salari / Aircrack Commands
Created June 24, 2018 02:43 — forked from mtrovilho/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
// Install the latest Xcode, with the Command Line Tools.
// Install Homebrew
// Install aircrack-ng:
brew install aircrack-ng
// Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/sbin/airport
// Figure out which channel you need to sniff:
sudo airport -s
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
@mihai-salari
mihai-salari / CustomView.swift
Created October 16, 2017 12:08 — forked from soggybag/CustomView.swift
CustomView Class adds designable and inspectable properties for Corner radius, border color, and border width
import UIKit
@IBDesignable
class CustomView: UIView {
@IBInspectable var borderColor: UIColor? = UIColor.clearColor() {
didSet {
layer.borderColor = self.borderColor?.CGColor
}
}
@mihai-salari
mihai-salari / ViewController.swift
Created October 16, 2017 12:08 — forked from soggybag/ViewController.swift
Short snippet for drawing a sine curve with UIBezierPath
// Draw a sine curve
let centerY = frame.height / 2 // find the vertical center
let steps = 200 // Divide the curve into steps
let stepX = frame.width / CGFloat(steps) // find the horizontal step distance
// Make a path
let path = UIBezierPath()
// Move the starting point to the left center
path.moveToPoint(CGPoint(x: 0, y: centerY))
// Loop and draw steps in straingt line segments
@mihai-salari
mihai-salari / ViewController.swift
Created October 16, 2017 12:08 — forked from soggybag/ViewController.swift
Sine Wave with fill using UIBezierPath
// Draw a sine curve with a fill
let centerY = frame.height / 2 // find the vertical center
let steps = 200 // Divide the curve into steps
let stepX = frame.width / CGFloat(steps) // find the horizontal step distance
// Make a path
let path = UIBezierPath()
// Start in the lower left corner
path.moveToPoint(CGPoint(x: 0, y: frame.height))