<?
function null($null) {
    return null;   
}
By SH2, 2018-02-20 11:31:33
<input type="button" value="Go and fill  later" onclick="javascript:window.location='<?php echo $url; ?>info.php'" />

Well, a is obsolete, let's do links as buttons!

By Anonymous, 2017-02-14 20:36:30
public static bool HasValues<T>(this ICollection<T> collection)
{
    if (collection == null)
    {
        return false;
    }
    if (collection.Count == 0)
    {
        return false;
    }
    return true;
}
By oskarnrk, 2017-12-12 16:49:43
// TODO(as): MAKE XML DOXYGEN THING SO IDE WITH COLORS CAN READ THIS
package main

import (
	"os"
	"sync"

	_ "github.com/mailru/easyjson"
	_ "github.com/satori/go.uuid"
	_ "github.com/valyala/fasthttp"
)

func main() {
	sync.Once(func(){}())

	myMutexLockVariable := struct {
		IDontKnowHowEmbeddingWorks *sync.RWMutex // FOR SCALEABILITY
	}{
		func() *sync.RWMutex {
			return new(sync.RWMutex) // FACTORY PATTERN FACTORY PATTERN!
		}(),
	}
	
	lockthelock := func(){
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	}
	unlockthelock := func(){
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	}
	// TODO(as): THERE THEM FUNCTIORNS NO WORKY ABSTRACTION FOR SOME REASON
	// SO WE JUST CALL myMutexLockVariable.IDontKnowHowEmbeddingWorks FUNCTIONS
	// DIRECTLY THERE IS A BUG INSIDE OF THE GO PROGRAMMING LANGUAGE
	//
	// GO ISSUE NUMBER: 181393
	// Description: GO NO WORKY, I PUT FUNCTORS TO ACCESS MY LOCK AND IT DEAD LOCK
	// cc: bradfitz, ian lance taylor, rob pike, ken, even brian k
	lockthelock = lockthelock
	unlockthelock = unlockthelock
	    // I DONT WANNA DELETE FUNCY BECAUSE I WORK TOO HARD ON THEM WE KEEP IT FOR USE LATER WHEN GO FIXES BUG

	var err error
	if myMutexLockVariable.IDontKnowHowEmbeddingWorks == nil {
		panic("whoops, you forgot to put the pointer of the mutex!!!!!")
		os.Exit(0xbadc0de) // FOR SAFTEY
	}
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.RLock()
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // just grease the wheels a bit
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	go func() {
		println("goroutine!")
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock()
	}()

	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock() // WAIT FOR BABY TO FINISH
	if &err != nil {
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // DO IT HERE FASTER THAN DEFUR
		main()
		os.Exit(0) // YAY
	}
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // DO IT HERE FASTER THAN DEFUR
}

THIS CODE IS COVERED BY THE GNU AFFERO PUBIC LICENSE, DO NOT SHARE THIS CODE WITHOUT PUBLISHING ALL OF YOUR CHANGES. FREE SOFTWARE FREEEEEDOM!!!

TO SEE THE TEXINFO MANUAL IN EMACS, TYPE CONTROL X CLOVER CLOVER DOT 9

By github.com/as, 2019-10-18 19:26:43
CREATE FUNCTION [dbo].[get_number_of_workers] 
(
     @number_of_workers varchar(10)
 
)
RETURNS int
AS
BEGIN
 
 
set @number_of_workers = replace(replace(replace(replace(LTRIM(RTRIM(@number_of_workers)), char(9), ''), char(10), ''), char(13),''), char(13)+char(10), '')
 
DECLARE @temp varchar(10)
 
SELECT
    @temp = number_of_workers 
FROM
    (SELECT LTRIM(RTRIM(@number_of_workers)) as number_of_workers) as temp
WHERE
       number_of_workers like  '[0-9]'
    or number_of_workers like  '[0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
     
     
RETURN CONVERT(INT, @temp)
 
END
By Anonymous, 2015-07-22 14:59:09
const errorHandler = () => {
  throw new Error();
};
By Anonymous, 2018-10-08 19:35:38
var query = $("#search-query");
query.click(function() {
  if (query.val() == 'szukaj...') {
     query.val('');
  }
});
By Kadet, 2016-02-14 14:54:32
        $gallery = \common\models\UtVideogallery::find()->select(['ut_videogallery.VideogalleryID',
                'ut_videogallery.Name_rus','ut_videogallery.TournamentID','ut_videogallery.MatchID', 'Slug',
                'ut_videogallery.Date','COUNT(ut_video_to_gallery.VideoToGalleryID) count','ut_matches_videos.Data',
                'm1.Data DataP'])
                ->leftJoin('ut_video_to_gallery','ut_video_to_gallery.VideogalleryID=ut_videogallery.VideogalleryID')
                ->leftJoin('ut_matches_videos','ut_matches_videos.VideoID=ut_video_to_gallery.VideoID')
                ->leftJoin('ut_matches_videos m1','m1.VideoID=ut_videogallery.PreviewID')
                ->where(['ut_videogallery.Active'=>1])
                //->andWhere(['TournamentID'=>$list['selected']])
                ->groupBy('ut_videogallery.VideogalleryID')
                ->orderBy('ut_videogallery.Date DESC')
                ->limit(self::$countPerPage)
                ->asArray()->all();
        foreach ($gallery as $key => $value) {
            if($value['count']==0) unset($gallery[$key]);
        }
        foreach($gallery as $k=>$v){
            if(isset($v['Data']))
                $v['Data'] = str_replace('http:','https:',$v['Data']);
            if(isset($v['DataP']))
                $v['DataP'] = str_replace('http:','https:',$v['DataP']);
            $gallery[$k]=$v;
        }
        $galleryCount = \common\models\UtVideogallery::find()->select(['ut_videogallery.VideogalleryID',
                'ut_videogallery.Name_rus','ut_videogallery.TournamentID','ut_videogallery.MatchID',
                'ut_videogallery.Date','COUNT(ut_video_to_gallery.VideoToGalleryID) count','ut_matches_videos.Data'])
                ->leftJoin('ut_video_to_gallery','ut_video_to_gallery.VideogalleryID=ut_videogallery.VideogalleryID')
                ->leftJoin('ut_matches_videos','ut_matches_videos.VideoID=ut_video_to_gallery.VideoID')
                ->leftJoin('ut_matches_videos m1','m1.VideoID=ut_videogallery.PreviewID')
                ->where(['ut_videogallery.Active'=>1])
                //->andWhere(['TournamentID'=>$list['selected']])
                ->groupBy('ut_videogallery.VideogalleryID')   
                ->orderBy('ut_videogallery.Date DESC')
                ->asArray()->all();
        foreach ($galleryCount as $key => $value) {
            if($value['count']==0) unset($galleryCount[$key]);
        }
        $pagination = new \yii\data\Pagination(
        [
            'totalCount' => count($galleryCount),
            'pageSize' => self::$countPerPage,

        ]);

Picasso of PHP

By chernomorets, 2017-03-03 11:26:18
let foo = {} // object no. 1
let bar = {} // object no. 2

foo > bar // return false
foo < bar // return false, so maybe foo equals bar?
foo == bar // oh well, return false
// but
foo >= bar // return true, 'cause !(foo < bar) == true

return value is expected, but JS is funny

By Anonymous, 2021-03-12 21:08:32
value unless value.select! { |v| v != "0" }.nil?

I don't not know no why not no one of my "predecessor" committed this shit.

By Penguin, 2018-08-09 04:37:29
if(
  (!_.isEmpty($(switcher).val()) && value_isnt == ":empty") ||
  ((value_isnt) && !$(switcher).is(value_isnt) && value_isnt != ':empty') ||
  (value_is && $(switcher).is(value_is) && value_is != ':empty') ||
  (value_is == ':empty' && _.isEmpty($(switcher).val())) ||
  (value && _switcherValue == value) ||
  (valueIn && .anyMatchInArray(valueIn.split(','), .flatten([_switcherValue]))) ||
  (valueOut && !.anyMatchInArray(valueOut.split(','), .flatten([_switcherValue])))
)
By Alex, 2017-06-08 15:58:10
if (i === 1 || i === 2 || i === 3 || i === 4 || i === 5 || i === 6 || i === 7 || i === 8 || i === 9 || i === 10){
 return true;
}
By foxy, 2017-12-13 23:25:17
if ( x == true)
{
    // do something
}

Fucking amateurs :| lol

By Manoochehr Mojgani, 2017-12-19 10:03:29
public void Handle(SomethingCreatedEvent e)
{
    if (e.ActCode == "SOME_VALUE")
    {
        return;
    }
    else
    {
        // insert real function body here
    }
}
By Anonymous, 2017-12-20 15:40:49
contracts = Contract.objects.filter(staff=staff).filter(active=True)
if contracts.__len__() > 0:
   ind = contracts.__len__() - 1
   dic[‘active_contract_id’] = contracts[ind].id
else:
   dic[‘active_contract_id’] = contracts[0].id

Get last object of queryset in django

By itsN0ll, 2018-01-29 11:35:27