Skip to content

Instantly share code, notes, and snippets.

@Nemikolh
Nemikolh / to_palettte_app.mjs
Created October 28, 2022 20:54
Tailwind extract color palette to visualize them in https://palettte.app/
#!/usr/bin/env node
import colors from 'tailwindcss/colors.js';
const res = [];
for (const color in colors) {
const colorVariants = colors[color];
if (typeof(colorVariants) !== 'object') {
continue;
}
@Nemikolh
Nemikolh / CustomParticleCulling.cs
Created June 4, 2021 08:03 — forked from karljj1/CustomParticleCulling.cs
Custom particle culling
using UnityEngine;
public class CustomParticleCulling : MonoBehaviour
{
public float cullingRadius = 10;
public ParticleSystem target;
CullingGroup m_CullingGroup;
Renderer[] m_ParticleRenderers;
@Nemikolh
Nemikolh / playground.rs
Created May 11, 2018 12:59 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![feature(generators, generator_trait)]
use std::ops::Generator;
use std::mem::size_of;
fn test() -> impl Generator<Yield=(), Return=()> {
return || {
let a: String = "test".into();
yield ();
println!("{}", a);
@Nemikolh
Nemikolh / playground.rs
Created May 11, 2018 12:59 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![feature(generators, generator_trait)]
use std::ops::Generator;
use std::mem::size_of;
fn test() -> impl Generator<Yield=(), Return=()> {
return || {
yield ();
}
}
@Nemikolh
Nemikolh / git-cheat-list.md
Created February 18, 2017 23:54
Git cheat list

Git cheat list

  • name of the current banch and nothing else (for automation)

    git rev-parse --abbrev-ref HEAD
    
  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
@Nemikolh
Nemikolh / playground.rs
Created May 1, 2016 20:53 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::marker::PhantomData;
use std::mem;
use std::ops::Add;
// Represents a pointer to a field of type `U` within the type `T`
#[derive(Debug)]
struct FieldOffset<T, U>(
// Offset in bytes of the field within the struct
usize,
@Nemikolh
Nemikolh / _fast_webpack.config.js
Last active October 23, 2015 11:01 — forked from oal/webpack.config.js
Webpack config for Pixi.js using Typescript.
// fast version does not includes shaders and filters
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: './src/game.js',
output: {
filename: 'build/game.js'
},
@Nemikolh
Nemikolh / box_iterator.rs
Last active August 29, 2015 14:25 — forked from anonymous/playground.rs
Box<Iterator<Item=&Trait>>
use std::slice::Iter;
trait Test {
fn hello(&self);
}
impl Test for i32 {
fn hello(&self) {
println!("i32 {}", self);
}
@Nemikolh
Nemikolh / main.rs
Created December 11, 2014 10:34
Rust dynamic dispatch vs static dispatch
trait Test {
fn toto(&self) -> String;
}
impl Test for uint {
fn toto(&self) -> String {
"uint".to_string()
}
}
#include "ptr_like.hpp"
int main()
{
vector<int> t {1, 2};
}