Skip to content

Instantly share code, notes, and snippets.

@Balamir
Balamir / st_key_bindings.json
Last active February 26, 2016 13:42
Sublime Text key bindings
[
{ "keys": ["ctrl+2"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+2"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["ctrl+k", "ctrl+,"], "command": "fold_by_level", "args": {"level": 10} },
/* Auto-pair underscores */
{ "keys": ["_"], "command": "insert_snippet", "args": {"contents": "_$0_"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
@Balamir
Balamir / itunes_connect_bulk_delete_inapp_purchase_products.js
Last active March 7, 2016 11:39
Bulk delete in-app purchase products on iTunes Connect
$('.pane-layout-content-header #textDiv').append($('<li id="del-script">').append($('<a class="js-nav">"').text('...')));
$('.itc-checkbox').parent().removeClass('ng-hide');
window.delscrpt = setInterval(function() {
$('.itc-checkbox input:checked').parents('tr').find('a.deleteIcon').each(function(){ $(this).click(); return false;});
var count = $('.itc-checkbox input:checked').parents('tr').find('a.deleteIcon').length;
if (count < 3) {
$('#del-script a').text('Del Done.');
clearInterval(window.delscrpt);
return;
@Balamir
Balamir / convert_array2object_object2_array.php
Created February 20, 2016 12:14
PHP stdClass Object to Array and Array to stdClass Object
<?php
/**
* Array veriyi Object'e donusturur
*
* Belirtilen array veriyi, tum alt array'lerle birlikte
* object'e donusturerek cikti verir
*
* @since 2.0
*
* @param array $array_data Object'e donusturulecek array veri
@Balamir
Balamir / foreach_after_nth_record.php
Last active February 17, 2016 11:38
PHP foreach - Close and reopen the 'tr' tag after nth record
<?php
$i = 0;
echo '<tr>';
foreach ($variable as $key => $value) {
$i++;
'<td>' . $key . '</td>' .
'<td>' . $value . '</td>';
// Close and reopen the 'tr' tag after fourth record
@Balamir
Balamir / Material More Button CSS.markdown
Created February 15, 2016 14:13
Material More Button CSS

Material More Button CSS

More Info button with material design style. Let me know if you've seen something like this. Used input:checked and a checkbox to build this, then used a tags to protect the click from unchecking the checkbox.

Forked from Alex Coven's Pen Material More Button CSS.

A Pen by Abdullah Ceylan on CodePen.

License.

@Balamir
Balamir / is_serialized.php
Created February 12, 2016 17:13
PHP is_serialized()
<?php
/**
* From Wordpress
* Check value to find if it was serialized.
*
* If $data is not an string, then returned value will always be false.
* Serialized data is always a string.
*
* @since 2.0.5
@Balamir
Balamir / turkish_country_list.php
Last active March 25, 2024 22:17
Ülke kodları ile birlikte Türkçe isimlendirilmiş ülke listesi - PHP Array
<?php
$countries_name_first = array(
'Türkiye' => 'TR',
'ABD Virgin Adaları' => 'VI',
'Afganistan' => 'AF',
'Aland Adaları' => 'AX',
'Almanya' => 'DE',
'Amerika Birleşik Devletleri' => 'US',
'Amerika Birleşik Devletleri Küçük Dış Adaları' => 'UM',
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@Balamir
Balamir / treehouse.sh
Last active August 29, 2015 14:06 — forked from yitsushi/treehouse.sh
#!/usr/bin/env sh
# If DEBUG environment variable is not defined set as false
if [[ "x${DEBUG}" == "x" ]]
then
DEBUG=false
fi
# Logger function. Display a message if DEBUG is true
logMessage() {