Skip to content

Instantly share code, notes, and snippets.

View simplyniceweb's full-sized avatar

Jaylord Ferrer simplyniceweb

  • Philippines
View GitHub Profile
@simplyniceweb
simplyniceweb / doctrine.notequal.php
Created August 7, 2018 11:31
Doctrine query not equal
<?php
use Doctrine\Common\Collections\Criteria;
class Classy
{
public function index()
{
$criteria = new Criteria();
$criteria->where(Criteria::expr()->neq('roles', 'ROLE_USER'));
@simplyniceweb
simplyniceweb / get higher value c lang
Created July 28, 2018 08:54
kiking do you love me
#include <stdio.h>
int main()
{
int n[3];
int a, max, min1, min2, index, num1, num2, num3;
printf("enter three numbers:\n");
scanf("%d%d%d", &num1, &num2, &num3);
n[0] = num1;
### Form builder ###
public function form(Request $request)
{
if("POST" == $request->getMethod()) {
if ($form->isValid()) {
$data = $form->getData();
echo $data->getTitle();
}
}
public void setRandomOptions()
{
String[] answers = {};
String[] options = {"PH", "USA", "NK", "SK"};
Integer opt = 0;
while (2 > opt) {
String randomOption = options[new Random().nextInt(options.length)];
$(function () {
var tordaFunctions = {
sayHi: function(name) {
console.log('Hi ' + name);
},
navFix: function() {
return $(document).on("scroll", function () {
var $nav = $(".navbar-fixed-top");
$nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height());
<!DOCTYPE html>
<html>
<head>
<style>
.red {
background-color: red;
height: 150px;
width: 150px;
}
.red.active {
<!DOCTYPE html>
<html>
<head>
<style>
body, html {
margin: 0;
padding: 0;
}
#wrapper {
width: 100%;
<?php
$host = "localhost";
$database = "mydb";
$username = "root";
$password = "";
try {
$connection = new PDO("mysql:host=$host;dbname=$database;charset=utf8", $username, $password);
} catch(PDOException $e) {
@simplyniceweb
simplyniceweb / database.php
Last active November 26, 2016 16:53
users
<?php
$servername = "localhost";
$database = "exercise";
$username = "root";
$password = "root";
$connection = new PDO ("mysql:host=$servername;dbname=$database;charset=utf8mb4", $username, $password);
/* End of file */
<?php
$servername = "localhost";
$database = "exercise";
$username = "root";
$password = "";
$conn = new PDO("mysql:host=$servername;dbname=$database;charset=utf8mb4", $username, $password);
$fullname = 'Jaylord Ferrer';