Skip to content

Instantly share code, notes, and snippets.

View zaimramlan's full-sized avatar
👨‍💻
Engineering

Zaim Ramlan zaimramlan

👨‍💻
Engineering
View GitHub Profile
@zaimramlan
zaimramlan / appstore_connect_users_list.js
Created August 17, 2018 16:30
Get list of AppStore Connect users and roles
var text = "Email, Name, Role,\n"
$('div.content-group').first().find('tbody').children().each(function() {
var email = $(this).children()[1].innerText
var name = $(this).children()[2].innerText.replace('Invitation Expired Resend', '')
var role = $(this).children()[3].innerText
text += `${email}, ${name}, ${role}\n`
})
var a = document.createElement("a");
@zaimramlan
zaimramlan / CustomBackButton.swift
Last active July 27, 2018 16:19
Snippet to create a custom back button with label + image
func CustomBackButton() {
leftView = UIView()
let image : UIImage = #imageLiteral(resourceName: "back_button")
let imageView = UIImageView(frame: CGRect(x: -15, y: 0, width: 30, height: 30))
imageView.contentMode = .scaleAspectFit
imageView.image = image
leftView.addSubview(imageView)
@zaimramlan
zaimramlan / QuickSupportExample.swift
Last active March 27, 2018 09:22
An iOS Quick Support screen represented using CleanSwift architecture
// Models File
// QuickSupportModels.swift
class QuickSupportModels {
...
enum CallSupport {
struct Request {
var viewController: UIViewController?
var supportPhoneNumber: String?
}
@zaimramlan
zaimramlan / WPCheatSheet.MD
Last active February 24, 2017 13:30
Wordpress Theme CheatSheet Links
@zaimramlan
zaimramlan / AppendURLParamInstapage.js
Created January 18, 2017 13:15
Script to auto append URL Parameters into links within InstaPage
/*
* PROBLEM: Instapage 'says' it appends the URL Parameters into the links in the landing pages,
* but they actually did not.
* SOLUTION: This is the script made to auto append url parameters into links
*
* BEGIN --->
*/
$('body').ready(function() {
var appended_url;
@zaimramlan
zaimramlan / LighttpdReverseProxy.MD
Last active November 13, 2016 12:05
Reverse Proxy With Lighttpd
### Reverse Proxy Begins ###

# redirect all '/sub_directory' request to '/sub_directory/' so that all static files are
# serve in the 'sub_directory' directory instead of the root directory
url.redirect = ("^/sub_directory$" => "/sub_directory/")

# start a proxy server at port 8001 to serve at the url exactly beginning with '/sub_directory/'
$HTTP["url"] =~ "^/sub_directory/+" {
 proxy.server = ( "" => ("" => ( "host" => "127.0.0.1", "port" => 8001 )))
@zaimramlan
zaimramlan / ZSHScriptFromScratch.MD
Created October 23, 2016 06:19
Create ZSH Script From Scratch
  1. Create new file with any name i.e. script.zsh
#!/bin/zsh
[COMMANDS_HERE]
  1. Configure permissions
$ chmod 755 script.zsh
@zaimramlan
zaimramlan / CLICopyPasteCommands.MD
Last active September 27, 2016 19:50
Copy and Paste Shell Commands via CLI

To Copy:

$ [COMMANDS] | pbcopy

To cd into path in clipboard:

$ cd $(pbpaste)
@zaimramlan
zaimramlan / HTML5FormValidation.MD
Last active September 20, 2016 08:46
Form Validation with HTML 5
<input type=[TYPE] pattern=[REGULAR_EXPRESSION] title=[HINT]>

Value(s) for REGULAR_EXPRESSION

^\d{4}-\d{3}-\d{4}$: For telephone numbers. (i.e. 0000-000-0000)

[a-zA-Z0-9]+: For alphanumeric values.

@zaimramlan
zaimramlan / SendAjaxRequest.MD
Last active September 17, 2016 14:21
Send AJAX Request via JS Function
function ajax_request() {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        if (this.readyState == [READY_STATE] && this.status == [HTTP_RESPONSE_CODE]) {
            // do something
        }
    };
    xhttp.open("GET", [REQUEST_PATH], true);
 xhttp.send();