(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
Shader "Projector/Light" { | |
Properties { | |
_Color ("Main Color", Color) = (1,1,1,1) | |
_ShadowTex ("Cookie", 2D) = "" {} | |
_FalloffTex ("FallOff", 2D) = "" {} | |
} | |
Subshader { | |
Pass { | |
ZWrite Off |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Creating a node graph editor for Dear ImGui | |
// Quick sample, not production code! | |
// This is quick demo I crafted in a few hours in 2015 showcasing how to use Dear ImGui to create custom stuff, | |
// which ended up feeding a thread full of better experiments. | |
// See https://github.com/ocornut/imgui/issues/306 for details | |
// Fast forward to 2023, see e.g. https://github.com/ocornut/imgui/wiki/Useful-Extensions#node-editors | |
// Changelog | |
// - v0.05 (2023-03): fixed for renamed api: AddBezierCurve()->AddBezierCubic(). |
bool ASMutator_WeaponReplacement::CheckRelevance_Implementation(AActor* Other) | |
{ | |
ASWeaponPickup* WeaponPickup = Cast<ASWeaponPickup>(Other); | |
if (WeaponPickup) | |
{ | |
for (int32 i = 0; i < WeaponsToReplace.Num(); i++) | |
{ | |
const FReplacementInfo& Info = WeaponsToReplace[i]; | |
if (Info.FromWeapon == WeaponPickup->WeaponClass) |
// Creating a node graph editor for ImGui | |
// Quick demo, not production code! This is more of a demo of how to use ImGui to create custom stuff. | |
// Better version by @daniel_collin here https://gist.github.com/emoon/b8ff4b4ce4f1b43e79f2 | |
// See https://github.com/ocornut/imgui/issues/306 | |
// v0.02 | |
// Animated gif: https://cloud.githubusercontent.com/assets/8225057/9472357/c0263c04-4b4c-11e5-9fdf-2cd4f33f6582.gif | |
// NB: You can use math functions/operators on ImVec2 if you #define IMGUI_DEFINE_MATH_OPERATORS and #include "imgui_internal.h" | |
// Here we only declare simple +/- operators so others don't leak into the demo code. | |
static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); } |
## Unity ## | |
*.cs diff=csharp text | |
*.cginc text | |
*.shader text | |
*.mat merge=unityyamlmerge eol=lf | |
*.anim merge=unityyamlmerge eol=lf | |
*.unity merge=unityyamlmerge eol=lf | |
*.prefab merge=unityyamlmerge eol=lf |
// | |
// imgui_color_gradient.cpp | |
// imgui extension | |
// | |
// Created by David Gallardo on 11/06/16. | |
#include "imgui_color_gradient.h" | |
#include "imgui_internal.h" |
/* C# code that sets up the mip colors texture: | |
s_MipColorsTexture = new Texture2D (32, 32, TextureFormat.RGBA32, true); | |
s_MipColorsTexture.hideFlags = HideFlags.HideAndDontSave; | |
Color[] colors = new Color[6]; | |
colors[0] = new Color (0.0f, 0.0f, 1.0f, 0.8f); | |
colors[1] = new Color (0.0f, 0.5f, 1.0f, 0.4f); | |
colors[2] = new Color (1.0f, 1.0f, 1.0f, 0.0f); // optimal level | |
colors[3] = new Color (1.0f, 0.7f, 0.0f, 0.2f); | |
colors[4] = new Color (1.0f, 0.3f, 0.0f, 0.6f); | |
colors[5] = new Color (1.0f, 0.0f, 0.0f, 0.8f); |