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
@kobeumut
kobeumut / MyServiceClass.kt
Last active August 25, 2017 08:48 — forked from BurakDizlek/MyServiceClass.kt
Retrofit Settings Sample
object MyService {
private val TIMEOUTOFSECOND = 15
private val _instanceOfService: Service by lazy { setupHttpClient() }
fun on(): Service {
return _instanceOfService
}
//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);
@kobeumut
kobeumut / wp.sh
Created November 12, 2017 09:46 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@kobeumut
kobeumut / embedded-file-viewer.md
Created December 17, 2017 19:06 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@kobeumut
kobeumut / gist:00908c5d52dcdf856e5fddf050a3d475
Created December 21, 2017 08:38 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@kobeumut
kobeumut / rails_server_helper.bash
Last active January 11, 2018 14:01 — forked from waiting-for-dev/rails_server_helper.bash
Stop and restart easily a rails server.
function rails() {
if [ "$1" = "start" ]; then
if [ "$2" = "" ]; then
RENV="production"
else
RENV="$2"
fi
rails server -p 80 -b 0.0.0.0 -d -e "$RENV"
return 0
elif [ "$1" = "stop" ]; then
@kobeumut
kobeumut / installing_rmagick_ubuntu_16.04.txt
Created March 18, 2019 09:49 — forked from ryderstorm/installing_rmagick_ubuntu_16.04.txt
Installing rmagick gem on Ubuntu 16.04
# the instructions from here: https://stackoverflow.com/questions/3704919/installing-rmagick-on-ubuntu/31089915#31089915
# worked, but only after I added in line 8
sudo apt-get purge graphicsmagick graphicsmagick-dbg imagemagick-common imagemagick imagemagick-6.q16 libmagickcore-6-headers libmagickwand-dev graphicsmagick-libmagick-dev-compat
sudo apt-get autoremove
sudo apt-get install imagemagick libmagickwand-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
gem install rmagick
@kobeumut
kobeumut / mutablelivedata.md
Created April 20, 2019 21:05 — forked from humblehacker/mutablelivedata.md
Don't expose MutableLiveData
@kobeumut
kobeumut / setup_digitalocean_rails.md
Created May 10, 2019 06:04 — forked from newmetl/setup_digitalocean_rails.md
Setup a Droplet on Digital Ocean for Rails with Nginx, Passenger and Postgresql

Setup new Server

This setup guide was created with the following components:

  • DigitalOcean Droplet (Ubuntu 16.04.4 x64)
  • Postgresql 9.5
  • Nginx + Passenger
  • Rails 5.2
  • Ruby 2.4.1
@kobeumut
kobeumut / DateExtension.kt
Created August 12, 2020 20:58 — forked from maiconhellmann/DateExtension.kt
Date extensions wrote in Kotlin
import java.text.SimpleDateFormat
import java.util.*
/**
* Pattern: yyyy-MM-dd HH:mm:ss
*/
fun Date.formatToServerDateTimeDefaults(): String{
val sdf= SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
return sdf.format(this)
}