Skip to content

Instantly share code, notes, and snippets.

View emnsen's full-sized avatar
💭
^^

emin şen emnsen

💭
^^
View GitHub Profile
@emnsen
emnsen / clean-tweets.js
Last active June 17, 2022 13:22
Clean your tweets without app
javascript: (function() {
function deleteTweet() {
var tweet = document.querySelector('[data-testid="tweet"]');
var caret = tweet.querySelector('[data-testid="caret"]');
caret.click();
var deleteItem = document.querySelector('[role="menuitem"]');
if (!deleteItem) {
return;
}
if (deleteItem.textContent !== "Delete") {
@emnsen
emnsen / VariableExtractor.php
Last active May 17, 2022 13:43
twig variable extractor #symfony #twig
<?php declare(strict_types=1);
namespace App\Twig;
use Twig\Environment;
use Twig\Node\Expression\ConditionalExpression;
use Twig\Node\Expression\Filter\DefaultFilter;
use Twig\Node\Expression\FilterExpression;
use Twig\Node\Expression\FunctionExpression;
use Twig\Node\Expression\NameExpression;
#! /bin/bash
RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)'
step="$1"
if [ -z "$1" ]
then
step=patch
fi

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.

<?php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@emnsen
emnsen / iprange.py
Created March 19, 2018 14:16 — forked from reorx/iprange.py
#!/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
#
[
{
"country-name": "Afghanistan",
"iso2": "AF",
"iso3": "AFG",
"top-level-domain": "af",
"fips": "AF",
"iso-numeric": "004",
"geonameid": "1149361",
"e164": "93",