Skip to content

Instantly share code, notes, and snippets.

View seyfer's full-sized avatar
💭
pet the duck until exploded

Oleg Abrazhaev seyfer

💭
pet the duck until exploded
View GitHub Profile
@wa0x6e
wa0x6e / build.xml
Last active April 23, 2018 20:03
Faster php lint target for jenkins php
<!--
More faster : lint only modified files
--------------------------------------
We create a new target to retrieve a list of modified files
If there is modified files, execute the lint target, else skip
with the `if="modifiedFiles"` option.
The list of modified files is stored in ${files.modified}, one file per line.
@seyfer
seyfer / gearmand
Created February 3, 2015 07:27
Gearmand init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: gearmand
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: gearmand
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@romansklenar
romansklenar / Blob.php
Created August 15, 2010 03:36
Doctrine 2, BLOB datatype implementation
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@jdecool
jdecool / behat.yml
Created May 7, 2017 10:39
Use Chrome Headless with Behat
default:
extensions:
Behat\MinkExtension:
base_url: http://localhost:8000
default_session: selenium2
selenium2:
browser: chrome
wd_host: http://127.0.0.1:4444/wd/hub
capabilities:
chrome:
// ПоПацански.cpp : Defines the entry point for the console application.
//
// #include "stdafx.h"
#define подъёбку setlocale
#define чуть_чуть 7
#define так_себе 12
#define пошло_оно_всё 120
@IMelker
IMelker / code_format.sh [recursive clang-format]
Last active July 26, 2019 08:45
clang-format wrapper for multifile ussage [cpp]
#!/bin/bash
# ------------------------------------------------------------
# Recursive cpp code formatter based on clang-format
# For base work there is you need to have .clang-format file
#
# USAGE code_format.sh [clang-format-options] [<file|dir> ...]
#
# clang-format-options passes through to clang-format
# ------------------------------------------------------------
@learner-long-life
learner-long-life / gist:38f207816554b8bbffef58aa7cfebcf1
Created May 5, 2017 01:18
How to iterate over a Jackon JsonNode / Java Map Entry iterator in Scala
import scala.collection.JavaConverters._
import com.fasterxml.jackson.core.JsonFactory
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.{JsonNodeFactory, MissingNode, ObjectNode}
val jf = new JsonFactory(true)
val o = new ObjectNode(jf)
o.put("yellow","banana")
for (v <- o.fields.asScala) { println(v.getKey(),v.getValue()) }
@davidhund
davidhund / feature-detect flexbox.js
Last active October 17, 2019 16:02
The simplest feature-detect for flexbox?
/*
* Trying to feature-detect (very naive)
* CSS Flexbox support.
* - Only most modern syntax
*
* Is this nonsense?
*/
(function NaiveFlexBoxSupport(d){
var f = "flex", e = d.createElement('b');
@karolyi
karolyi / termin.sh
Last active December 16, 2019 12:48
Best appointment date finder for the Berlin authorities
#!/usr/bin/env bash
RETCODE=1
# Change the URL in the curl commandline for yourself.
while [[ $RETCODE == 1 ]]; do
echo -n "$RANDOM ... "
OUT=$(curl -gs "https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&anliegen[]=121598&dienstleisterlist=122210,122217,122219,122227,122231,122238,122243,122252,122260,122262,122254,122271,122273,122277,122280,122282,122284,122285,122286,122296,150230,122301,122297,122294,122312,122314,122304,122311,122309,317869,324433,325341,324434,122281,122276,122274,122267,122246,122251,122257,122208,122226,121646&herkunft=http%3A%2F%2Fservice.berlin.de%2Fdienstleistung%2F121598%2F&asd=$RANDOM"|grep '"buchbar'|head -1|grep 'datum=2015-10')
RETCODE=$?
@samsonasik
samsonasik / gist:3988701
Created October 31, 2012 17:57
Send HTML Mail Using ZF2
use Zend\Mail\Message;
use Zend\Mail\Transport\Smtp as SmtpTransport;
use Zend\Mime\Message as MimeMessage;
use Zend\Mime\Part as MimePart;
use Zend\Mail\Transport\SmtpOptions;
//////////
$message = new Message();