Skip to content

Instantly share code, notes, and snippets.

View kobeumut's full-sized avatar
🏠
Working from home

Umut ADALI kobeumut

🏠
Working from home
View GitHub Profile
@BurakDizlek
BurakDizlek / Service.kt
Last active August 25, 2017 08:47
Retrofit interface sample
interface Service {
@FormUrlEncoded
@POST("info/getInfoDetail")
fun GetInfoDetail(@FieldMap params: HashMap<String, Any>): Call<InfoDetailObject>
@GET("search/{search_word}")
fun getSuggestSearchWords(@Path("search_word") search_word: String): Call<SearchWorObject>
@ryanpraski
ryanpraski / google_sheet_script_removeEmptyRows_removeEmptyColumns.js
Last active September 21, 2017 07:30
Google Sheet Script removeEmptyRows removeEmptyColumns
//Remove All Empty Columns in the Entire Workbook
function removeEmptyColumns() {
var ss = SpreadsheetApp.getActive();
var allsheets = ss.getSheets();
for (var s in allsheets){
var sheet=allsheets[s]
var maxColumns = sheet.getMaxColumns();
var lastColumn = sheet.getLastColumn();
if (maxColumns-lastColumn != 0){
sheet.deleteColumns(lastColumn+1, maxColumns-lastColumn);
@BurakDizlek
BurakDizlek / navigationViewSlide.kt
Last active November 6, 2017 10:22
Navigation View pust to content screen.
val toggle = object : ActionBarDrawerToggle(this, binding.drawerLayout, null, R.string.ok, R.string.close) {
override fun onDrawerSlide(drawerView: View?, slideOffset: Float) {
super.onDrawerSlide(drawerView, slideOffset)
if (drawerView === binding.navigationView)
binding.screen.translationX = slideOffset * drawerView.width
else if (drawerView === binding.navigationViewRight)
binding.screen.translationX = -(slideOffset * drawerView.width)
binding.drawerLayout.bringChildToFront(drawerView)
binding.drawerLayout.requestLayout()
}
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.1-curl php7.1-cli php7.1-dev php7.1-gd php7.1-intl php7.1-mcrypt php7.1-json php7.1-mysql php7.1-opcache php7.1-bcmath php7.1-mbstring php7.1-soap php7.1-xml php7.1-zip -y
sudo mv /etc/apache2/envvars /etc/apache2/envvars.bak
sudo apt-get remove libapache2-mod-php5 -y
sudo apt-get install libapache2-mod-php7.1 -y
sudo cp /etc/apache2/envvars.bak /etc/apache2/envvars
@BurakDizlek
BurakDizlek / MyServiceClass.kt
Last active July 16, 2018 13:11
Retrofit Settings Sample
object MyService {
private val TIMEOUTOFSECOND = 12
private val _instanceOfService: Service by lazy { setupHttpClient() }
fun on(): Service {
return _instanceOfService
}
@BurakDizlek
BurakDizlek / safeEnumKotlin.kt
Last active June 14, 2019 09:27
no enum constant for default safe enum value
inline fun <reified T : kotlin.Enum<T>> safeEnumValueOf(type: String?,defaultEnum:T): T {
return try {
java.lang.Enum.valueOf(T::class.java, type)
} catch (e: Exception) {
defaultEnum
}
}
country longmin latmin longmax latmax
Aruba -70.983 12.4 -69.85 12.617
Antigua and Barbuda -62.417 16.817 -61.65 17.75
United Arab Emirates 45 22.167 59.25 26.133
Afghanistan 60.433 29.15 75.033 38.484
Algeria -8.7 18.027 70.554 37.203
Azerbaijan 44.783 38.417 50.858 41.911
Albania 19 39.583 21.05 42.659
Armenia 43.443 38.857 46.589 41.3
Andorra 1.417 42.433 1.783 42.65
@dakcarto
dakcarto / OSGeoLive-to-Parallels.txt
Created March 18, 2014 20:40
Convert OSGeoLive .vmdk to Parallels virtual machine
### Converting to Parallels ###
# convert .vmdk to a Parallels machine (tested on Mac OS X 10.9 and Parallels 9)
# first launch /Applications/Parallels\ Desktop.app (provides service for prl_convert)
# NOTE: the converted vm is named 'Ubuntu Linux.pvm' by default;
# ensure /<dest-volume> does not already contain a similarly named vm
# in Mac's Terminal.app
$ /Applications/Parallels\ Desktop.app/Contents/MacOS/prl_convert <path-to>/osgeo-live-7.9.vmdk --dst=/<dest-volume> --reg=n
WARNING: Reconfiguration iso is unavailable. Linux guest reconfiguration is impossible
Conversion progress: 100 %
The source third-party virtual disk was successfully converted to a Parallels virtual machine stored in /<some-other-volume>/Ubuntu Linux.pvm.
@halilim
halilim / rails_admin.tr.yml
Last active September 28, 2019 10:17 — forked from paracycle/rails_admin.tr.yml
rails_admin tr locale
tr:
admin:
js:
true: Doğru
false: Yanlış
is_present: Mevcut
is_blank: Boş
date: Tarih ...
between_and_: ... ile ... arası
today: Bugün
@owen2345
owen2345 / _myslider.html.erb
Last active March 13, 2020 08:32
Camaleon CMS Create Own Custom Fields (Complex)
#/themes/e_shop/views/custom_field/_my_slider.html.erb
<div class="group-input-fields-content" data-callback-render="render_my_custom_slider">
<div class="form-group">
<label>Image:</label>
<div class="input-group">
<input data-dimension="<%= field.options[:dimension] %>" data-versions="<%= field.options[:versions] %>" data-thumb_size="<%= field.options[:thumb_size] %>" type="url" name="<%= field_name %>[<%= field.slug %>][values][][image]" class="data-error-place-parent image_field form-control <%= "required" if field.options[:required].to_s.to_bool %>"/>
<span class="input-group-addon btn_upload" onclick="load_upload_image_field($(this).prev());"><i class="fa fa-upload"></i> <%= t('camaleon_cms.admin.button.upload_image')%> <%= "(#{field.get_option('dimension')})" if field.get_option('dimension').present? %></span>
</div>
</div>
<div class="clearfix">