Skip to content

Instantly share code, notes, and snippets.

View saji89's full-sized avatar

Saji Nediyanchath saji89

View GitHub Profile
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@hoandang
hoandang / laravel-artisan-cheatsheet
Last active December 5, 2023 17:27
Laravel artisan cheatsheet
Available commands:
clear-compiled Remove the compiled class file
down Put the application into maintenance mode
env Display the current framework environment
help Displays help for a command
inspire Display an inspiring quote
list Lists commands
migrate Run the database migrations
optimize Cache the framework bootstrap files
serve Serve the application on the PHP development server
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@nerandell
nerandell / code-review-checklist.md
Last active May 21, 2024 17:43
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
<!--
In Vue, we use v-model for all form bindings, while
Knockout maintains separate binding types, such as
textInput, checked, and options. In some cases,
such as for an input of type "range", Knockout
simply doesn't have an equivalent two-way binding
helper and the more verbose value and valueUpdate
must be used.
-->
<div id="app">
@thehelvetian
thehelvetian / addRowToSpreadsheet.php
Last active October 31, 2021 20:04
Add a new row to a spreadsheet using Google Sheets API v4
<?php
/**
* This is a proof of concept. In real life you would split up the various parts and allow for different cell value
* types. Also read Leviscowles1986's comment below:
* https://gist.github.com/thehelvetian/2e94d60b796735b167dfb1c7560049ae#gistcomment-1822986
*
* @param array $ary_values An array containing the cell values
* @return bool Request status
*/
function addRowToSpreadsheet($ary_values = array()) {
@bizmate
bizmate / Blackfire agent config
Last active April 20, 2020 22:16
Blackfire dockerisation
[blackfire]
; setting: log-file
; desc : Sets the path of the log file. Use stderr to log to stderr
; default: stderr
log-file=/tmp/blackfire-agent.log
;
; setting: log-level
; desc : log verbosity level (4: debug, 3: info, 2: warning, 1: error)
@AndrewCarterUK
AndrewCarterUK / sitepoint-survey-parser.php
Last active May 12, 2016 10:53
Verifying PHPixie fraud on SitePoint survey
<?php
// https://raw.githubusercontent.com/sitepoint-editors/php-fw-survey-2015/master/dump/survey.csv
$stream = fopen('survey.csv', 'r');
$headers = fgetcsv($stream);
$count = 0;
$phpixieCount = 0;
$nonPhpixieErrorCount = 0;
@AndrewCarterUK
AndrewCarterUK / phpixie-stats.php
Created May 9, 2016 14:07
Script used to verify fraudulent installs on PHPixie.
<?php
function getJsonPage($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);