Skip to content

Instantly share code, notes, and snippets.

View r3ne-pew's full-sized avatar
🚀
pew pew

Rene Henkenius r3ne-pew

🚀
pew pew
View GitHub Profile
@r3ne-pew
r3ne-pew / runcmd.cs
Created November 4, 2016 07:59
Run Python Script in c#
private void run_cmd(string cmd, string args)
{
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = cmd;//cmd is full path to python.exe
start.Arguments = args;//args is path to .py file and any cmd line args
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
using(Process process = Process.Start(start))
{
using(StreamReader reader = process.StandardOutput)
@r3ne-pew
r3ne-pew / dgv_addimage.cs
Created November 4, 2016 08:16
Add Image to DataGridView c#
Image img = (Image) e.Row.FindControl("Image1");
img.ImageUrl = setImageURLHere;
@r3ne-pew
r3ne-pew / fibonacci.cs
Created January 10, 2017 09:58
Fibonacci Calculation (Iterative + Recursive)
using System;
namespace Fibonacci
{
class Program
{
static void Main(string[] args)
{
while (true) {
Console.WriteLine("How Long? - ");
@r3ne-pew
r3ne-pew / mergesort.cs
Last active January 25, 2017 12:31
C# Merge Sort
using System;
using System.Collections;
namespace mergesort
{
class MainClass
{
public static void Main(string[] args)
{
int count = Convert.ToInt32(Console.ReadLine());
@r3ne-pew
r3ne-pew / setTime.cs
Created January 23, 2017 09:13
Unity Countdown
void setTime()
{
secondsLeft--;
string op = "Time: " + secondsLeft;
countdown.GetComponent<Text>().text = op;
if (secondsLeft == 0)
{
lose.SetActive(true);
Time.timeScale = 0;
}
@r3ne-pew
r3ne-pew / uiCountdownController.cs
Created January 23, 2017 09:17
Unity UI Countdown
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIController : MonoBehaviour
{
public GameObject countdown;
public GameObject lose;
@r3ne-pew
r3ne-pew / trafficSpawner.cs
Last active January 23, 2017 09:44
Unity Traffic Spawner
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TrafficController : MonoBehaviour {
public GameObject Car;
public GameObject CarParent;
private bool spawnLeft;
private float[] lanes;
@r3ne-pew
r3ne-pew / RFC822_regex.cs
Created July 2, 2017 21:53
Regex: RFC822
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
@r3ne-pew
r3ne-pew / pyramide.py
Created February 28, 2020 20:52
generate pyramid print in python
reihen = 5
reihen = int (reihen)
for i in range (0, reihen):
for j in range(0, i + 1):
print("x", end=' ')
print("\r")
for i in range (reihen, 0, -1):
for j in range(0, i -1):
print("x", end=' ')
@r3ne-pew
r3ne-pew / npm-docker.sh
Created July 1, 2020 09:33
Dockerized npm install
docker run --user $(id -u):$(id -g) -v $PWD:/app -v $PWD/.npm:/.npm -v $PWD/.config:/.config -w /app node:lts-stretch-slim npm install