Skip to content

Instantly share code, notes, and snippets.

View akinozgen's full-sized avatar
:bowtie:

Akın Özgen akinozgen

:bowtie:
View GitHub Profile
@artiya4u
artiya4u / find_database_size.sql
Created January 25, 2017 07:34
Query to find database size.
SELECT sum(round(((data_length + index_length) / 1024 / 1024 / 1024), 2)) AS "Size in GB"
FROM information_schema.TABLES
WHERE table_schema = 'MY_DATABASE'
apt-get update
apt-get upgrade
apt-get install sudo git build-essential htop apt-transport-https ca-certificates curl gnupg2 software-properties-common # python-software-properties
# apt-get install openjdk-7-jre
# user
useradd -s /bin/bash -m -d /home/eserozvataf -c "eser ozvataf" -g staff eserozvataf
gpasswd -a eserozvataf sudo
echo "AllowGroups sudo" >> /etc/ssh/sshd_config
passwd eserozvataf
apt-get update
apt-get upgrade
apt-get install sudo git build-essential htop apt-transport-https ca-certificates curl gnupg2 software-properties-common # python-software-properties
# apt-get install openjdk-7-jre
# user
useradd -s /bin/bash -m -d /home/akinozgen -c "akinozgen" -g staff akinozgen
gpasswd -a akinozgen sudo
echo "AllowGroups sudo" >> /etc/ssh/sshd_config
passwd akinozgen
@adriengibrat
adriengibrat / Object.prototype.watch.js
Last active April 23, 2020 19:24
Object.prototype.watch "polyfill"
/**
* Object.prototype.watch polyfill
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch
*
* Known limitations:
* - `delete object[property]` will remove the watchpoint
*
* Based on Eli Grey gist https://gist.github.com/eligrey/384583
* Impovements based on Xose Lluis gist https://gist.github.com/XoseLluis/4750176
* This version is optimized for minification

Install npm module

npm install react-native-maps --save

Top-Level build.gradle

add google() and change classpath com.android.tools.build:gradle:3.0.1

// Top-level build file where you can add configuration options common to all sub-projects/modules.
@dsmrt
dsmrt / alter-table-ignore-dupes.sql
Created July 12, 2018 17:13
Mysql - Remove duplicates by adding a unique key.
-- Reference: https://stackoverflow.com/questions/36647058/removing-duplicates-with-unique-index
ALTER IGNORE TABLE mytable ADD UNIQUE INDEX myindex (A, B, C, D);
@gauravat16
gauravat16 / ActivityName.java
Last active December 6, 2022 22:54
[Android] Add Context Menu to RecyclerView
//Import Statements
public class ActivityName extends AppCompatActivity {
private RecyclerView mRecyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@tayfunerbilen
tayfunerbilen / php-instagram-info.php
Created February 14, 2023 11:25
instagram kullanici bilgileri ve son postlari alan kod
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://www.instagram.com/' . $_GET['username'] . '/embed/',
CURLOPT_USERAGENT => 'Mozilla/5.0 (Linux; Android 6.0.1; SM-G935S Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36',
CURLOPT_RETURNTRANSFER => true
]);
$output = curl_exec($ch);
curl_close($ch);
@simivar
simivar / print_r_reverse.php
Last active November 4, 2023 23:27
PHP function to reverse print_r function
<?php
/**
* I've published a fully-tested Composer library with type-casting.
* @see https://github.com/simivar/reverse-print-r
*/
/**
* Matt: core
* Trixor: object handling
* lech: Windows suppport
@yasinkuyu
yasinkuyu / daterangepicker.tr.js
Created June 30, 2016 21:19
Daterangepicker Turkish
//daterangepicker.js
$(function() {
function cb(start, end) {
$('#reportrange span').html(start.format('MMMM D') + ' - ' + end.format('MMMM D'));
}
cb(moment().subtract(29, 'days'), moment());
$('#reportrange').daterangepicker({