Skip to content

Instantly share code, notes, and snippets.

View ckhampus's full-sized avatar

Cristian Hampus ckhampus

View GitHub Profile
@paulloz
paulloz / content.md
Last active June 15, 2024 09:51
Visual Studio Code and C# code completion and debugger for Godot

Visual Studio Code and C# code completion and debugger for Godot

Ok, this is a quick document to guide you through the setup of a Godot project in Visual Studio Code.
I'll assume you have a working C# environment installed. Note that on Linux, you might need to install Mono for everything to work fine with Godot 3.x.

1. Install the necessary extensions

First off, make sure you have the following extensions installed and active in Visual Studio Code:

@benoitongit
benoitongit / my_vue_component.coffee
Last active May 8, 2021 10:24
Make Vue.js works with Ruby on Rails and Turbolinks 5. Gem is available here: https://github.com/benoitongit/vue-on-rails
@MyComponent =
props: ['myProp']
template: '<div>A custom component with {{myProp}}</div>'
@paulirish
paulirish / what-forces-layout.md
Last active July 20, 2024 17:43
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@koemeet
koemeet / JsonApiSerializer.php
Created November 21, 2014 20:33
JMS Serializer & willdurand Hateoas JSON-API serializer
<?php
/**
* This file is part of the Mango package.
*
* (c) Mango
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@lisamelton
lisamelton / transcode-video.sh
Last active May 24, 2024 17:42
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
@jamesmontemagno
jamesmontemagno / MvxUIRefreshControl
Created August 23, 2013 19:36
MvvmCross Implementation of UIRefreshControl that you can use inside of TableViews or CollectionViews
using System;
using MonoTouch.UIKit;
using System.Windows.Input;
namespace com.refractored.mvxbindings
{
/// <summary>
/// Mvx user interface refresh control.
/// </summary>
public class MvxUIRefreshControl : UIRefreshControl
# Worked under these envelopment
#
# AMI: amzn-ami-pv-2012.09.0.x86_64-ebs (ami-4e6cd34f)
# Zone: ap-northeast-1b
# Type: m1.large
#
# CentOS phpenv (https://github.com/CHH/phpenv) system wide installation script
# Execute as root user.
# Set group to use phpenv:
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@paulirish
paulirish / rAF.js
Last active July 19, 2024 19:50
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];