Skip to content

Instantly share code, notes, and snippets.

using System.Linq;
using System.Text;
using UnityEngine;
public class D
{
/// <summary>
/// Author: WeslomPo
/// InspiredBy: Ant.Karlov
@romelgomez
romelgomez / development.ts
Created December 8, 2016 22:31
Express Server with TypeScript
import * as server from "./server";
new server.App
@van800
van800 / RiderUnityIntegration.cs
Last active November 9, 2017 16:29
Unity3D JetBrains Rider cross-platform Integration
moved to https://github.com/JetBrains/Unity3dRider
@gre
gre / AutoCaptureGLThing.js
Last active August 23, 2017 10:42
example that render things offscreen with gl-react – would love if you find a way to make this use-case less hacky
class AutoCaptureGLThing extends Component {
onRef = exportable => {
if (!exportable || this.exporting) return;
this.exporting = true;
exportable.captureFrame(/* see https://projectseptemberinc.gitbooks.io/gl-react/content/docs/api/Surface.html */)
.then(path => { // oops back to node callback pattern via props callback
this.props.onCapture(null, path);
}, error => {
this.props.onCapture(error);
});
@brennanMKE
brennanMKE / hero.ts
Last active April 1, 2024 16:16
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@paulirish
paulirish / what-forces-layout.md
Last active May 6, 2024 07:54
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
@subfuzion
subfuzion / global-gitignore.md
Last active May 5, 2024 19:34
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@dogles
dogles / UISortBehavior.cs
Created December 17, 2014 14:12
MonoBehaviour for sorting Renderers against NGUI widgets.
using UnityEngine;
public class UISortBehavior : MonoBehaviour
{
public UIWidget widgetInFrontOfMe;
[System.NonSerialized]
Renderer m_renderer;
void Awake() {
@xem
xem / codegolf.md
Last active March 22, 2024 15:41
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

@visenger
visenger / install_scala_sbt.sh
Last active January 31, 2023 19:10
Scala and sbt installation on ubuntu 12.04
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update