Skip to content

Instantly share code, notes, and snippets.

View nickiaconis's full-sized avatar

Nick Iaconis nickiaconis

View GitHub Profile
@nickiaconis
nickiaconis / SeasonsMod.cs
Created November 10, 2019 06:00
idea for mod to change seasons in Cities: Skylines
// pseudo code for idea to change seasons in Cities: Skylines
onInterval() {
string loadedEnvironment = Singleton<LoadingManager>.instance.m_loadedEnvironment;
string simulationEnvironment = Singleton<SimulationManager>.instance.m_metaData.m_environment;
if (winterDateRange.contains(currentDate) && loadedEnvironment != WINTER) {
// Properties scene loading/unloading based on propertiesScene loading in LoadingManager#LoadLevelCoroutine
// not sure if unloading will break things
// also not sure if loading second properties scene will break things
// order may matter
// may also simply not be possible
@nickiaconis
nickiaconis / .vimrc
Created May 11, 2017 19:35
Workaround for `set backupdir=~/.vim/backup//`
" from http://stackoverflow.com/a/38479550/2085526
" === BACKUP SETTINGS ===
" turn backup OFF
" Normally we would want to have it turned on. See bug and workaround below.
" OBS: It's a known-bug that backupdir is not supporting
" the correct double slash filename expansion
" see: https://code.google.com/p/vim/issues/detail?id=179
set nobackup
" set a centralized backup directory
@nickiaconis
nickiaconis / components.i-fail-assertion.js
Last active March 22, 2017 23:11
Reproducing assert.throws Bug
import Ember from 'ember';
export default Ember.Component.extend({
init () {
Ember.assert('This assertion always fails.', false);
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: ['foo', 'bar'],
foo: null,
bar: null,
});
@nickiaconis
nickiaconis / controllers.application.js
Last active June 24, 2016 21:18
Actions Bubble Up Routes
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@nickiaconis
nickiaconis / components.aggregate-list.js
Last active June 23, 2016 20:53
Pass Argument to Closure Action
import Ember from 'ember';
import SendInviteMixin from '../mixins/send-invite';
export default Ember.Component.extend(SendInviteMixin, {
});
@nickiaconis
nickiaconis / RESULTS.md
Last active February 25, 2018 06:57
Expand Properties Benchmark

$ node index.js
status quo x 183,314 ops/sec ±7.01% (81 runs sampled)
comma fix x 88,004 ops/sec ±5.18% (81 runs sampled)
alternate fix x 88,608 ops/sec ±4.89% (84 runs sampled)
regex match fix x 36,670 ops/sec ±5.04% (83 runs sampled)
iteration fix x 175,519 ops/sec ±5.20% (84 runs sampled)
nested x 88,474 ops/sec ±3.91% (82 runs sampled)

@nickiaconis
nickiaconis / .A-README.md
Last active December 25, 2016 05:19
BashGitPrompt Rainbow Theme
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@nickiaconis
nickiaconis / prefetch.js
Created October 14, 2015 21:39
Route#prefetch & Route#prefetched
App.PostRoute = Ember.Route.extend({
prefetch(params) {
return this.store.findRecord('post', params.id);
}
});
App.PostCommentsRoute = Ember.Route.extend({
prefetch(params, transition) {
return this.store.findAll('comments', transition.params.post.id);
},