Skip to content

Instantly share code, notes, and snippets.

@chez14
chez14 / proton.sh
Created November 1, 2020 10:50
Proton script to run non-Steam Apps on Linux. Supposedly you have to install Steam first (requires Steam account). Then put this to `/usr/bin/proton.sh` and add required file permissions.
#!/bin/bash
# Credits: https://pastebin.com/NJxfe8Ex
PROTON_VERSION="5.0"
PROTON_DIR=$HOME/.steam/steam/steamapps/common/Proton\ $PROTON_VERSION
RUNNING="$1"
if [ ! -f "$PROTON_DIR/proton" ] ; then
echo "Proton version $PROTON_VERSION not found!";
@Airyzz
Airyzz / sphere_packing.py
Created September 5, 2020 06:42
Blender Sphere Packing Generator
import bpy
from mathutils import *
import random
rad = 5
numSpheres = 5000
resolution = 0.1
spheres = list()
def dist(point1, point2):
@bitinn
bitinn / bitinn.py
Last active January 11, 2024 01:36
Blender keymap for busy Maya / Unity / Substance Designer users
# version: 1.0.1
# latest source: https://gist.github.com/bitinn/22f6fefe026d8d9e83468864edb8f835
import bpy
import os
def kmi_props_setattr(kmi_props, attr, value):
try:
setattr(kmi_props, attr, value)
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@rdavisau
rdavisau / dark-style-from-vs-2015.json
Created February 25, 2016 04:26
dark-style-from-vs-2015.json
{
"name":"dark-style-from-vs-2015",
"version":"1.0",
"description":"Imported color scheme",
"originator":"Imported from /Users/rdavis/Library/XamarinStudio-5.0/HighlightingSchemes/dark-style-from-vs-2015.vssettings",
"colors":[
{"name": "Background(Read Only)", "color":"#1E1E1E" },
{"name": "Search result background", "color":"#005F60" },
{"name": "Search result background (highlighted)", "color":"#007F80" },
{"name": "Fold Square", "color":"#A5A5A5" },
// LoadingScreenManager
// --------------------------------
// built by Martin Nerurkar (http://www.martin.nerurkar.de)
// for Nowhere Prophet (http://www.noprophet.com)
//
// Licensed under GNU General Public License v3.0
// http://www.gnu.org/licenses/gpl-3.0.txt
using UnityEngine;
using UnityEngine.UI;
@grifdail
grifdail / gulpfile.js
Last active June 5, 2018 13:35
Simple babel livereload
var gulp = require('gulp'),
babel = require('gulp-babel'),
livereload = require('gulp-livereload'),
http = require('http'),
st = require('st'),
transform = require('vinyl-transform'),
browserify = require('browserify');
gulp.task('js', ["es6"],function() {
@josheinstein
josheinstein / MyDbContext.cs
Created April 16, 2014 20:07
When using Entity Framework code-first with LINQPad (or any time an EF DbContext is subclassed) any calls to Database.SetInitializer with the base class is effectively ignored. This is especially irritating with LINQPad which needs to subclass the context class in order to work the way it is designed. This means that if you called Database.SetIn…
public class MyDbContext : DbContext
{
/// <summary>
/// Initializes a new instance of the <see cref=“T:MyDbContext"/> class.
/// </summary>
public MyDbContext( )
: base( "DefaultConnection" )
{
@McNull
McNull / Binder.cs
Created November 27, 2012 18:29
Json Model Binding with Knockout and ASP.NET MVC
namespace System.Web.Mvc {
public class JsonModelBinder : IModelBinder {
private readonly static System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) {
var stringified = controllerContext.HttpContext.Request[bindingContext.ModelName];
if (string.IsNullOrEmpty(stringified))
return null;
return serializer.Deserialize(stringified, bindingContext.ModelType);
}
@florisrobbemont
florisrobbemont / DbSeederMigrator.cs
Created August 4, 2012 15:27
EF: Bundle Seed code with Migration classes for seeding per migration
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text.RegularExpressions;
/// <summary>
/// Provides advanced migrations by providing a seeding platform for each migration.