Skip to content

Instantly share code, notes, and snippets.

View emnsen's full-sized avatar
💭
^^

emin şen emnsen

💭
^^
View GitHub Profile
@leevigraham
leevigraham / Generate ssl certificates with Subject Alt Names on OSX.md
Last active June 11, 2024 09:48
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

We're going to generate a key per project which includes multiple fully qualified domains. This key can be checked into the project repo as it's intended for local development but never used on production servers.

Save ssl.conf to your my_project directory.

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

@ummahusla
ummahusla / git-overwrite-branch.sh
Last active May 20, 2024 16:27 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
<?php
namespace ExampleBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use ExampleBundle\Entity\ExampleTranslation; // is a Personal Translation
class ExampleAdmin extends Admin
{
/**
#!/usr/bin/env python
# coding: utf-8
#
# Copyright (C) Michael Ihde 2004 <mike.ihde@randomwalking.com>
#
# Distributed under the Python License
#
# iprange is a useful module that creates iprange generators similar
# to python's xrange. This allows you to write statements such as
#
@nnmer
nnmer / AddTranslatedFieldSubscriber.php
Last active May 22, 2019 09:20 — forked from noetix/TranslatedFieldType.php
Translated Field Type for Symfony 2.8
<?php
namespace Acme\DemoBundle\Form\EventListener;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\FormError;
@JamieMason
JamieMason / is_installed.sh
Last active February 17, 2024 10:12
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@ekrembk
ekrembk / sehir_tespiti.js
Created November 6, 2012 10:14
Kullanıcının şehrini Javascript ile otomatik tespit etme. HTML5 Geocoding API ve Reverse Geocoding için Yandex Geocoder kullanıldı.
function otomatikBul() {
// Browser desteğini kontrol et
if( ! navigator.geolocation ) {
console.log( 'Broserınız desteklemiyor. Lütfen manual seçim yapınız.' );
return;
}
// Uyarı
console.log( 'Koordinatlar alınıyor...' );
<?php
namespace ExampleBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use ExampleBundle\Form\EventListener\addTranslatedFieldSubscriber;