This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Illuminate\Database\QueryException] | |
| // SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`)) | |
| use Illuminate\Support\Facades\Schema; | |
| public function boot() | |
| { | |
| Schema::defaultStringLength(191); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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: " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var variable = "New Things" | |
| print(variable.take(6)) // # => New Th | |
| print(variable.takeLast(6)) // # => Things |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.samclarke.android.util | |
| import java.security.MessageDigest | |
| /** | |
| * Hashing Utils | |
| * @author Sam Clarke <www.samclarke.com> | |
| * @license MIT | |
| */ | |
| object HashUtils { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var test = {}; | |
| if (test==null && isEmpty(test)) { | |
| console.log("is empty"); | |
| } else { | |
| console.log("is not empty"); | |
| } | |
| function isEmpty(obj) { | |
| for (var key in obj) { | |
| if (obj.hasOwnProperty(key)) | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var exceptionOfBreak = {}; | |
| try { | |
| ["a", "b", "c"].forEach(function(el) { | |
| console.log(el); | |
| if (el === "b") throw exceptionOfBreak; | |
| }); | |
| } catch (e) { | |
| if (e == exceptionOfBreak) console.log("for loop is break"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function onEdit(e){ | |
| var getRow = e.source.getActiveRange().getRow().toFixed(0); | |
| var newSheet=SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; //I Select First Sheet. | |
| if(newSheet.getSheetId()==SpreadsheetApp.getActiveSheet().getSheetId()){ | |
| var rowrange =SpreadsheetApp.getActiveSheet().getDataRange().offset(getRow-1, 0, 1); | |
| rowrange.setBackground("#49fff933"); | |
| var cache = PropertiesService.getUserProperties().getProperty("array"); | |
| PropertiesService.getUserProperties().setProperty("array",(cache!=undefined||cache!=null)?cache+","+getRow:getRow); | |
| newSheet.appendRow([PropertiesService.getUserProperties().getProperty("array")]); //Show add your row number | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //if you only want to use within your restriction you use vetoable | |
| var name by vetoable("adali") { property: KProperty<*>, oldValue, newValue -> | |
| newValue.startsWith("A") | |
| } | |
| name = "umut" | |
| // # : name = "adali" ->because name not startwith S so | |
| name = "Adanalı" | |
| // # : name = "adanali" -> that's it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET @serial=0; | |
| UPDATE table_name SET new_product_id = @serial := @serial+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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); |