Skip to content

Instantly share code, notes, and snippets.

View alperg's full-sized avatar

Alper Gokcehan alperg

  • RTP, NC, United States
View GitHub Profile
@alperg
alperg / extjs-overnesting.js
Created July 23, 2013 13:49
Overnesting highlighter
javascript:(Ext.ComponentManager.each(function(c) {
c = Ext.getCmp(c);
if (c.isContainer && !c.isHeader && !c.isXType('tablepanel') && !c.isXType('headercontainer') && !c.hasCls('x-fieldset-header') && c.items.items.length === 1) {
console.log(c.id + ' only contains 1 child: check for overnesting');
c.rendered && c.el.frame('red');
}
}));
/**
* How to override toolbar menu's default behavior
* (enableOverflow = true)
*/
Ext.define('Ext.layout.container.boxOverflow.CustomToolbarMenu', {
extend: 'Ext.layout.container.boxOverflow.Menu',
showTrigger: function() {},
});
@alperg
alperg / StoreInViewModel.js
Created October 16, 2014 13:04
ExtJS 5 store in viewmodel
In file MyApp/store/Menu.js
Ext.define('MyApp.store.Menu', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.menu.Root'
],
model: 'MyApp.model.menu.Root',

Install MongoDB with Homebrew

brew install mongodb
mkdir -p /data/db

Set permissions for the data directory

Ensure that user account running mongod has correct permissions for the directory:

@alperg
alperg / index.html
Last active November 9, 2015 18:32
Radios in timeline
<section class="survey">
<div class="wrapper">
<h2 class="title text-center">headline</h2>
<p class="intro text-center">text</p>
<form class="survey__form" action="#">
<!--<hr class="survey-hr"/>-->
<ul class="radio-list">
<li class="radio-list__radio-item">
<input class="radio-item__input" type="radio" name="radio-choice" id="radio-choice-1" value="choice-1"/>
@alperg
alperg / index.html
Last active November 9, 2015 18:34
Radios in timeline - 2
<div class="wrapper">
<h1>How well does your team use data?</h1>
<h5>Select the number that best applies</h5>
<form action="#">
<hr />
<div class="average">
<div class="line"></div>
<p>average</p>
</div>
<ul>
@alperg
alperg / index.html
Last active November 9, 2015 18:36
Simple calendar view
<table>
<thead>
<tr>
<th></th>
<th>Sun</th>
<th>Mon</th>
<th>Tue</th>
<th>Wed</th>
<th>Thu</th>
<th>Fri</th>
@alperg
alperg / index.html
Created November 9, 2015 18:43
HTML5 Simple Form
<heading>
<div class="wrapper">
<h1>asdf</h1>
<h2>qwerty</h2>
</div>
</heading>
<section>
<div class="wrapper">
<div class="form-row">
<label>Show Name</label>
@alperg
alperg / index.html
Created November 9, 2015 18:49
Location object
<h1>Location Object</h1>
<div class="search-bar" id="url">
<span id="origin"></span><span id="path"></span><span id="hash"></span>
</div>
<div class="container">
<a href="#home">home</a>
<a href="#about">about</a>
<a href="#portfolio">portfolio</a>
<div id="response"></div>
@alperg
alperg / AJAX Request with JavaScript.markdown
Last active November 9, 2015 18:59
AJAX Request with JavaScript - StackOverflow API

AJAX Request with JavaScript

This is a basic example of how to write an AJAX request with raw JavaScript. Or in other words, query an API and output the response onto a page. Here, we're using the StackOverflow API.