Skip to content

Instantly share code, notes, and snippets.

View damienwebdev's full-sized avatar
💻
Working on Daffodil @graycoreio

Damien Retzinger damienwebdev

💻
Working on Daffodil @graycoreio
View GitHub Profile
import React from 'react';
import ReactDOM from 'react-dom'
import Todo from 'Todo';
export const TodoList = ({todos, onTodoClick}) => (
<ul>
{todos.map(todo => <Todo key={todo.id} {...todo} onClick={() => onTodoClick(todo.id)} />)}
</ul>
);
import { connect } from 'react-redux'
import { toggleChoice } from '../actions/index'
import ChoiceSet from '../components/ChoiceSet';
const getChoices = (choices, choiceType) => {
return choices.filter(t => t.choiceType == choiceType)
};
const mapStateToProps = (state) => {
return {
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Description;
public function __construct(App $app, $api_key = null)
{
$this->app = $app;
$this->api_key = $api_key;
}
gulp.task("webpack-dev-server", function() {
// modify some webpack config options
var myConfig = Object.create(webpackConfig);
// Start a webpack-dev-server
new WebpackDevServer(webpack(myConfig),{
contentBase: 'build',
inline:true
})
.listen(8080, "localhost", function(err) {
var a = [{
id: 1
}, {
id: 2
}];
var b = [{
id: 1
}, {
id: 2
public interface A{
public boolean method(Base B);
}
public class Parent{
}
public class Child extends Parent{
<?php
use MyModel;
class ExampleClass {
public static function sumMyData(){
$sum = 0;
$myIdsArray = [];
$myIdsArray = MyModel::getMyListOfIdsFromDb();
$collection = MyModel::getCollection($myIdsArray);
foreach($object in $collection){
$sum = sum + $object->value;
@damienwebdev
damienwebdev / Mage_Core_Model_Layout_Update.php
Last active December 14, 2017 15:18
Broken Widget function
<?php
class Mage_Core_Model_Layout_Update {
public function fetchDbLayoutUpdates($handle)
{
$_profilerKey = 'layout/db_update: '.$handle;
Varien_Profiler::start($_profilerKey);
$updateStr = $this->_getUpdateString($handle);
if (!$updateStr) {
return false;
}
@damienwebdev
damienwebdev / Mage_Widget_Helper_Data.php
Created December 14, 2017 19:14
Magento Widget XML/HTML Entities 500 Error Fix
<?php
class Mage_Widget_Helper_Data extends Mage_Core_Helper_Abstract
{
/**
* Further refine escaped HTML.
*/
public function escapeHtml($data, $allowedTags = null)
{
$parent = parent::escapeHtml($data, $allowedTags);