Skip to content

Instantly share code, notes, and snippets.

View akinozgen's full-sized avatar
:bowtie:

Akın Özgen akinozgen

:bowtie:
View GitHub Profile
@akinozgen
akinozgen / gist:e97ba2e2e663939ac4d31137db5d93f1
Created April 29, 2017 11:07 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@akinozgen
akinozgen / .htaccess
Last active March 20, 2018 11:24 — forked from alch/.htaccess
Symfony full .htaccess file
# Based on http://stackoverflow.com/questions/17313023/symfony-2-2-1-url-rewrite-issue
# Use the front controller as index file. It serves as fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# startpage (path "/") because otherwise Apache will apply the rewritting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php
#DirectoryIndex app_dev.php
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
@akinozgen
akinozgen / alter-table-ignore-dupes.sql
Created October 4, 2021 14:52 — forked from dsmrt/alter-table-ignore-dupes.sql
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);