Skip to content

Instantly share code, notes, and snippets.

View nehalist's full-sized avatar

Kevin nehalist

View GitHub Profile
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
// Router
this.resource('notes', function() {
this.resource('notebook', { path: ':notebook_id' }, function() {
this.resource('note', { path: ':note_id' });
});
});
// models/note.js
import DS from 'ember-data';
\index.php
\wp-blog-header.php
\wp-load.php
\wp-config.php
\wp-settings.php
\wp-includes\load.php
\wp-includes\default-constants.php
\wp-includes\version.php
\wp-includes\compat.php
\wp-includes\random_compat\random.php
getInitialData: ->
return $q (resolve, reject) =>
if(@data.length > 0)
resolve @data
else
reject 'data not loaded'
// api/models/Passport.js
var bcrypt = require('bcryptjs');
/**
* Hash a passport password.
*
* @param {Object} password
* @param {Function} next
*/
function hashPassword (passport, next) {
# service
@app.factory 'CurrentUser', ($http) ->
$http({
method: 'GET',
url: 'users/me'
}).then (user) =>
# i want to return the user object
return # ... what?
// models/Project.js
module.exports = {
attributes: {
title: {
type: Sequelize.STRING
}
},
associations: function() {
Project.belongsTo(Customer);
Project.hasMany(Contributor);
module.exports = function(grunt) {
grunt.config.set('ts', {
assets: {
files: [
{
expand: true,
cwd: 'assets/js/',
src: [
'**/*.ts'
],
// config.xml
[...]
<frontend>
<layout>
<updates>
<foobar>
<file>foobar.xml</file>
</foobar>
</updates>
</layout>
import {ConfigurationLoaderInterface} from "./ConfigurationLoaderInterface";
export class JsonConfigurationLoader implements ConfigurationLoaderInterface {
handle(file: string): Object {
return require(file);
}
}