Skip to content

Instantly share code, notes, and snippets.

View joelmandell's full-sized avatar
🏐
:)

Joel Mandell joelmandell

🏐
:)
View GitHub Profile
@joelmandell
joelmandell / GQLHelper.cs
Created November 21, 2019 22:46
Helper to create Lamda expression to use in Linq-query when combining graphql-dotnet with entity framework and iqueryables.
using System;
using System.Linq;
using System.Linq.Expressions;
using GraphQL.Language.AST;
using GraphQL.Types;
public static class GQLHelper
{
public static Expression<Func<T, T>> GraphQLFields<T>(ResolveFieldContext<object> ctx)
{
@joelmandell
joelmandell / gist:b8ccd17c29925f4ee4d1
Created November 2, 2015 21:11
CodeIgniter - newsmodel kodsnutt
<?php
class NewsModel extends Model {
var $permission_table;
function NewsModel()
{
parent::Model();
$this->load->database();
@joelmandell
joelmandell / gist:0eea0fb35751ce1777b2
Created November 2, 2015 21:10
CodeIgniter - BlogController kodsnutt
<?php
class Blog extends Controller {
function Blog($page=0)
{
parent::Controller();
$this->load->library('session');
$this->load->database();
$this->load->library('form_validation');
@joelmandell
joelmandell / gist:1b20fa5bf61bfb580480
Created November 2, 2015 21:10
CodeIgniter - UserController kodsnutt
<?php
/*TODO Make comment about the goal with this class and quick examples!!!!!*/
class User extends Controller {
var $pages;
function User()
@joelmandell
joelmandell / gist:0357efee2442c7981def
Created November 2, 2015 21:07
CodeIgniter - blogmodel.php kodsnutt
<?php
class BlogModel extends Model {
var $permission_table;
function BlogModel()
{
parent::Model();
$this->load->database();
@joelmandell
joelmandell / gist:82a82588196dade90aa9
Created November 2, 2015 21:06
CodeIgniter - usermodel.php kodsnutt
<?php
class UserModel extends Model {
function UserModel()
{
parent::Model();
$this->load->library('auth');
$this->load->database();
$this->load->library('session');
@joelmandell
joelmandell / Auth.php
Created November 2, 2015 21:04
CodeIgniter kod snutt 1 - Authklass.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*TODO Make comment about the goal with this class and quick examples!!!!!
All those code-duplicated $CI = & get_instance(); references, need to do something about it.
Make use of the now null initialized $this->CI variable, so the procedure doesn't get repated all the time.
*/
/*
Auth class is an helper to easy interact with user information.