Skip to content

Instantly share code, notes, and snippets.

View twokul's full-sized avatar
😎

Alex Navasardyan twokul

😎
View GitHub Profile
@twokul
twokul / CLAUDE.md
Created January 5, 2026 20:47
~/.claude/CLAUDE.md
<interaction>
  Clarify unclear requests via AskUserQuestionsTool, then proceed
  autonomously. Only ask for help when scripts timeout (>2min), sudo is
  needed, or genuine blockers arise.

Never say "You are absolutely right" or "You are absolutely wrong". Use

@twokul
twokul / hidden-classes-in-js-and-inline-caching.md
Last active December 2, 2025 04:22
Hidden classes in JavaScript and Inline Caching

Hidden classes in JavaScript and Inline Caching

Knowing how internals work is always a good. Pretty much for everything. Cars, trains, computers, you name it. It gives you an insight on what happens under the hood. You also act/react differently based on this knowledge.

As you might have guessed, it’s also true for web development. Knowledge of CSS transitions allows you to achieve better performance and not to use JavaScript in most cases. Knowledge of V8 internals allows you to write more performant JavaScript code. So let’s talk about V8 a little.

A little about V8

V8 is a JavaScript engine built by Google. Firefox built SpiderMonkey, Opera built Carakan and Microsoft built Chakra. One very important difference between V8 and other JavaScript engines is that V8 doesn’t generate any intermediate code. It compiles JavaScr

import Ember from 'ember';
const MAX = 1157;
export default Ember.Component.extend({
tagName: 'rect',
attributeBindings: ['computedHeight:height'],
computedHeight: Ember.computed('facet.count', function() {
let facetCount = this.get('facet.count');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
series: Ember.computed(function() {
return [
null,
{ leftLimit: '67500.00', rightLimit: '72800.00', y: 26 },
null
desc "Compile all the assets named in config.assets.precompile"
task :precompile do
# We need to do this dance because RAILS_GROUPS is used
# too early in the boot process and changing here is already too late.
if ENV["RAILS_GROUPS"].to_s.empty? || ENV["RAILS_ENV"].to_s.empty?
ENV["RAILS_GROUPS"] ||= "assets"
ENV["RAILS_ENV"] ||= "production"
Kernel.exec $0, *ARGV
else
Rake::Task["environment"].invoke
@twokul
twokul / usa_topo.json
Created October 23, 2013 20:38
usa topojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@twokul
twokul / cp.js
Created September 5, 2013 18:14
cp-set
App.Person = Ember.Object.extend({
firstName: null,
lastName: null,
fullName: function(key, value, oldValue) {
// setter
if (arguments.length > 1) {
var nameParts = fullNameString.split(/\s+/);
this.set('firstName', nameParts[0]);
this.set('lastName', nameParts[1]);
}
App.AjaxObject = Ember.Object.create({
value: function() {
// makes an ajax call to get new value
return service.getValue();
}.property().volatile()
});
$('<span></span>').css({display:'none',whiteSpace:'nowrap'}).appendTo($('body')).text('U. S. Government Accountability Office, http:// www.gao.gov').width()