Skip to content

Instantly share code, notes, and snippets.

Avatar

Tolga Ozses kartagis

View GitHub Profile
View BlogController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BlogController extends Controller
{
/**
* Display a listing of the resource.
View DrupalVM error
vagrant@drupalvm:/var/www/drupalvm/drupal/web/sites$ apache2 -t
[Tue Dec 04 06:05:44.695289 2018] [core:warn] [pid 12410] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Tue Dec 04 06:05:44.695870 2018] [core:warn] [pid 12410] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Tue Dec 04 06:05:44.696349 2018] [core:warn] [pid 12410] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Tue Dec 04 06:05:44.696636 2018] [core:warn] [pid 12410] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Tue Dec 04 06:05:44.697012 2018] [core:warn] [pid 12410] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Tue Dec 04 06:05:44.712536 2018] [core:warn] [pid 12410:tid 139739474769792] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
View UploadForm.php
<?php
namespace Drupal\mitacan\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class MitacanUploadForm extends FormBase {
public function buildForm(array $form, FormStateInterface $form_state) {
$form['csv_upload'] = [
@kartagis
kartagis / mysql_countries.sql
Created May 26, 2017 — forked from kamermans/mysql_countries.sql
MySQL Dump - continents and countries with 2 and 3 char codes, names and full names - Braintree compatible as of Dec 2011
View mysql_countries.sql
/**
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree
* Payment API as of Dec 2011
*
* Compiled by Steve Kamerman, 2011
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
@kartagis
kartagis / README.md
Created Feb 16, 2017 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
View gist:3f35ff8f5422c39e8c5b787274f6ff9f

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
View cordovacheatsheet.md

##npm komutları

npm install -g cordova

node.js kullanarak cordova'yı bilgisayarınıza yükler.

##cordova komutları

cordova create hello com.example.hello HelloWorld

@kartagis
kartagis / PDO_mysql.connect.php
Created Aug 23, 2016 — forked from adrian-enspired/PDO_mysql.connect.php
how to make a new mysql connection with PDO.
View PDO_mysql.connect.php
<?php
$host = "db hostname";
$dbname = "db name";
$user = "db username";
$pass = "db password";
$charset = "UTF8MB4"; // if your db does not use CHARSET=UTF8MB4, you should probably be fixing that
$dsn = "mysql:host={$host};dbname={$dbname};charset={$charset}";
@kartagis
kartagis / auth.py
Created Dec 16, 2015 — forked from ibeex/auth.py
Python LDAP (ActiveDirectory) authentication
View auth.py
import ldap
def check_credentials(username, password):
"""Verifies credentials for username and password.
Returns None on success or a string describing the error on failure
# Adapt to your needs
"""
LDAP_SERVER = 'ldap://xxx'
# fully qualified AD user name
LDAP_USERNAME = '%s@xxx.xx' % username