Skip to content

Instantly share code, notes, and snippets.

View Balamir's full-sized avatar

Abdullah M. Ceylan Balamir

View GitHub Profile
@Balamir
Balamir / shortcut-simulator.sh
Created March 24, 2018 00:00
Make a shortcut for the iPhone Simulator on MacOS
ln -s /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app /Applications/iPhone\ Simulator.app
@Balamir
Balamir / gist:8e9ddb2b7931f1aea4c8f478967fc081
Created March 17, 2018 23:10
charles proxy -> Resolution for SSLHandshake: Remote host closed connection during handshake error
In iOS >= 10.3, you must take an additional step to trust the Charles Root Certificate that is not currently documented on their website:
Settings > General > About > Certificate Trust Testings
Source: https://www.neglectedpotential.com/2017/04/trusting-custom-root-certificates-on-ios-10-3/
@Balamir
Balamir / mac-os-checklist.txt
Last active March 13, 2018 13:05
MacOS - Before New Installation or Upgrade Checklist
* Backup / sync Apache configs
* Backup / sync browser settings
* Backup / sync Atom editor config
For Apache and PHP
* Check Apache root for the previous settings file. They will have a 'previous' suffix. Just rename.
* After upgrade, probably your PHP version will be changed. So, you should check your httpd.conf file for the PHP version.
For example your previous PHP version was 5.6. Then find the following line on your httpd.conf file after copy/paste:
php5_module libexec/apache2/libphp5.so
@Balamir
Balamir / gist:5e981d139730b2b0fca5e230c5225113
Last active February 24, 2018 00:01
Solution for 'Error: While resolving module `react-native-vector-icons/FontAwesome`, the Haste package `react-native-vector-icons` was found. However the module `FontAwesome` could not be found within the package. Indeed, none of these files exist' error on react-native
rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json
@Balamir
Balamir / gist:b12691e7aca61f4231a3de682b455e4e
Created February 13, 2018 23:38 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@Balamir
Balamir / sleep.js
Created January 29, 2018 23:20
JS Sleep with Promise
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
return await sleep(300).then(() => ({ console.log('waited 300ms'); });
@Balamir
Balamir / array_key_changer.php
Created January 27, 2018 21:14
This function can helps to replace an|multiple array key(s) with the new one.
<?php
/**
* Single or multiple array key changer.
*
* @author Abdullah M CEYLAN
* @author URI http://www.abdullahceylan.com
*
* @param {array} $array Old array
* @param {string | array} $old_key Old array keys that can be string or array
@Balamir
Balamir / delete_github_repo.sh
Last active October 28, 2017 15:08
Bulk Github repo deletion
# Create your delete_repo token -> https://github.com/settings/tokens
while read repo
do
curl -X DELETE -H "Authorization: token YOUR_DELETE_REPO_TOKEN" "https://api.github.com/repos/$repo"
done < repos.txt
@Balamir
Balamir / web.config
Created July 10, 2017 21:59
Wordpress MU Subdir - IIS rewrite rules - Solves when using sub-dir for the multisites configuration, trying to access mysite.com/subsite/wp-admin/ gives a 404 error.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule 1" stopProcessing="true">
<match url="^index\.php$" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="WordPress Rule 2" stopProcessing="true">
while true; do
read -p "Remove the themes folder (deletes all themes) and create a new one? [y/n] " yn
case $yn in
[Yy]* ) rm -rf themes/; mkdir themes/; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
while true; do