Skip to content

Instantly share code, notes, and snippets.

View alimoeeny's full-sized avatar
💭
Strong Opinions Weakly Held

Ali Moeeny alimoeeny

💭
Strong Opinions Weakly Held
View GitHub Profile
package;
import ui.Color;
import hxd.BitmapData;
import sys.io.File;
import hxd.Perlin;
function WorldGenTest() {
var w = 512;
var h = 512;
@alimoeeny
alimoeeny / identityNetwork.py
Created September 3, 2023 13:25
for testing and validation purposes, a keras based networks that returns the input image as is
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
IMAGE_SIDE = 256
input = layers.Input(shape=(IMAGE_SIDE, IMAGE_SIDE, 3))
x = keras.layers.Dense(3,"linear" )(input)
outputs = keras.layers.Dense(3, activation="linear")(x)
{
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.fontFamily": "Monoid, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 14,
@alimoeeny
alimoeeny / pre-commit
Last active June 9, 2020 13:27
git pre-commit hook for automatic versioning on every commit in golang
#!/bin/sh
#read more at http://alimoeenysbrain.blogspot.com/2013/10/automatic-versioning-with-git-commit.html
#replace all MYPROJECT with your project name
#for languages other than go (golang) replace all the .go extensions with your language extensions and modify BODY to reflect you language syntax
VERBASE=$(git rev-parse --verify HEAD | cut -c 1-7)
echo $VERBASE
NUMVER=$(awk '{printf("%s", $0); next}' MYPROJECTversion.go | sed 's/.*MYPROJECT\.//' | sed 's/\..*//')
echo "old version: $NUMVER"
@alimoeeny
alimoeeny / AWSBillingPermissions.json
Created May 18, 2020 10:45
AWS IAM Billing permissions
{
"Statement": [
{
"Action": [
"budgets:ViewBudget",
"cloudwatch:DescribeAlarmHistory",
"cloudwatch:GetDashboard",
"cloudwatch:GetMetricData",
"cloudwatch:DescribeAlarmsForMetric",
"cloudwatch:ListDashboards",
#if (UNITY_EDITOR)
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.IO;
public static class FLBuilder {
static string GetProjectName() {
string[] s = Application.dataPath.Split('/');
// <copyright file="InsideShader.cs" company="Google Inc.">
// Copyright (C) 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
package main
import (
"fmt"
"net/http"
)
func ServerModeBouncer(h http.Handler, mode *int64) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, q *http.Request) {
switch q.Method {
@alimoeeny
alimoeeny / pre-commit
Last active December 25, 2015 16:29
git pre-commit hook for automatic versioning on every commit in Matlab
#!/bin/sh
#read more at http://alimoeenysbrain.blogspot.com/2013/10/automatic-versioning-with-git-commit.html
#replace all MYPROJECT with your project name
#for languages other than matlab replace all the .go extensions with your language extensions and modify BODY to reflect you language syntax
#for go (golang) see this gits: https://gist.github.com/alimoeeny/7005725
VERBASE=$(git rev-parse --verify HEAD | cut -c 1-7)
echo $VERBASE
NUMVER=$(awk '{printf("%s", $0); next}' MYPROJECTversion.m | sed 's/.*MYPROJECT\.//' | sed 's/\..*//')