Skip to content

Instantly share code, notes, and snippets.

View plapinski's full-sized avatar

Paweł Łapiński plapinski

View GitHub Profile
@plapinski
plapinski / README.md
Created February 1, 2020 18:18 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@plapinski
plapinski / gist:52d16d6f455d010e71a6c1b92c2573ac
Created February 1, 2020 18:17 — forked from philfreo/gist:7257723
Facebook Perl source code from 2005. When browsing around thefacebook.com in 2005 the server spit out some server-side source code rather than running it. I believe this was for their old graph feature that let you visualize the graph between all your friends. The filename is `mygraph.svgz` and contains some gems such as a commented out "zuck" d…
#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
function testRepositoryUsage()
{
$id = 42;
$value = array('results');
$repo = $this->getMock('Repository\FindsStuffInCity');
$repo->expects($this->once())
->method('findByCityId')
->with($id)
->will($this->returnValue($value));
@plapinski
plapinski / Laravel PHP7 LEMP AWS.md
Created August 1, 2016 14:20 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@plapinski
plapinski / 0_reuse_code.js
Created June 1, 2016 09:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
public static function read_search($terms, $limit = 20)
{
$contact_results = Contact::where_account_user_id(Auth::user()->account_user_id)
->where_deleted(0)
->where_marketing(0)
->where_mass_merge(0)
->raw_where("match (`first`, `last`) against (?)", array($terms))
->take($limit)
->get();
<html>
<head>
<title>IE Placeholder Text</title>
</head>
<body>
<input type="text" name="myInputField" value="" placeholder="HTML5 Placeholder Text" id="myInputField">
<?php
/**
* @author Zauberfisch
* @method ManyManyList Products()
*/
class ProductCategoryPage extends Page {
private static $many_many = array(
'Products' => 'Product',
);