Skip to content

Instantly share code, notes, and snippets.

View savelee's full-sized avatar

Lee Boonstra savelee

View GitHub Profile
@savelee
savelee / Sencha Cmd
Last active August 9, 2021 12:36
How to switch Sencha Cmd versions from the command-line?
> sencha switch --list
//This gives the following output, depending on which versions you have installed on your machine:
Sencha Cmd 6.1.3.16
Looking for versions at: /Users/leeboonstra/bin/Sencha/Cmd
Current version
6.1.3.16
@savelee
savelee / .gitignore
Last active May 20, 2016 12:43
.gitignore for Sencha, Python, Node Projects
######################
# Python #
######################
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
@savelee
savelee / gist:9b107657b1c46ede0d3a46bb5f2a6bda
Created June 3, 2016 09:01
Digital Ocean - Install a free SSL certificate on Ubuntu with Apache.
1. First stop your droplet, and make a snapshot.
2. Login to you droplet
ssh root@<ip>
3. Go to https://certbot.eff.org/, select the setup for example Apache on Ubuntu 14
This will give you the instructions
These are the instructions for Ubuntu 14, with Apache.
We will install Certbot:
@savelee
savelee / gist:f6e9ca1b94eb88a649e784bf9260ecb8
Created June 15, 2016 17:37
Sencha software issues, due to wrong binding of localhost
//sudo nano /etc/hosts
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
How to enable server caching
Install the following 2 mods:
$ sudo a2enmod expires
$ sudo a2enmod headers
Add this to the .htaccess
<IfModule mod_expires.c>
ExpiresActive On
@savelee
savelee / Chart.js
Last active June 27, 2016 17:20
Out of the box Ext JS 6.2 - D3 implementation
Ext.define('Dashboard.view.contacts.Chart', {
extend: 'Ext.d3.svg.hierarchy.tree.HorizontalTree',
xtype: 'departments-chart',
requires: [
'Ext.d3.interaction.PanZoom'
],
nodeSize: [20, 70],
bind: {
store: '{department}',
selection: '{selection}'
@savelee
savelee / MyD3Chart.js
Last active September 21, 2017 07:00
Ext JS 6.2 - Extend from D3 base class example
Ext.define("Engine.view.charts.MyD3Chart",{
extend: "Ext.panel.Panel",
xtype: 'myd3chart',
requires: [
'Ext.d3.svg.Svg'
],
layout: 'fit',
scrollable: true,
items: [{
xtype: 'd3',
@savelee
savelee / .js
Created June 27, 2016 17:19
Ext JS 6.2 - custom D3: scenesetup: function(component, scene){ .. }
var store = Ext.getStore('Artists');
var max = store.getCount();
var i = 0, data = [], artists = [];
//I need two arrays, one with artist names, and one with playcounts. In my first try, I hardcoded it. Afterwards, I switched to a real store.
for(i; i<max; i++){
artists.push(store.getAt(i).get('name'));
data.push(store.getAt(i).get('playcount'));
}
@savelee
savelee / js
Created July 13, 2016 13:01
CustomProxy
Ext.define('Engine.model.LastFmResult', {
extend: 'Ext.data.Model',
requires: [
'Ext.data.identifier.Sequential',
'SenchaCandyShared.proxy.lastfm.LastFm'
],
identifier: {
type: 'sequential',
@savelee
savelee / example1.js
Last active July 25, 2016 14:14
JavaScript Hoisting: Variable declarations using var are treated as if they are at the top of the function (or global scope, if declared outside of a function) regardless of where these were placed.
//Note the differences with both foo() functions
(function() {
console.log(typeof foo); // prints "function"
foo(); // logs "hello sencha"
function foo() {
console.log("hello sencha!");
}