Skip to content

Instantly share code, notes, and snippets.

View george-chakhidze's full-sized avatar

George Chakhidze george-chakhidze

  • Tbilisi, Georgia
  • 05:56 (UTC +04:00)
View GitHub Profile
@DavidBuchanan314
DavidBuchanan314 / cursed_mandelbrot.c
Last active June 28, 2023 15:12
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout. Output can be seen at https://twitter.com/David3141593/status/1062468528115200001
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40
@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@kenegozi
kenegozi / XunitConsoleForwarder.cs
Created June 25, 2017 22:35
Capturing console output in Xunit 2 tests
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Xunit.Abstractions;
namespace MagicalUnicorns {
public class XunitConsoleForwarder : TextWriter {
private readonly ITestOutputHelper output;
@0xjac
0xjac / private_fork.md
Last active April 24, 2024 15:00
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@ummahusla
ummahusla / git-overwrite-branch.sh
Last active February 25, 2024 00:06 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 19, 2024 18:20
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@sayedihashimi
sayedihashimi / resolve-fullpath.ps1
Created August 5, 2014 09:11
PowerShell how to convert a relative path to a full path
# based off of http://mnaoumov.wordpress.com/2013/08/21/powershell-resolve-path-safe/
function Resolve-FullPath{
[cmdletbinding()]
param
(
[Parameter(
Mandatory=$true,
Position=0,
ValueFromPipeline=$true)]
[string] $path
@jstangroome
jstangroome / SetDnsRecordDemo.ps1
Created January 4, 2013 03:48
How to use Set-DnsServerResourceRecord in the Windows Server 2012 DnsServer PowerShell module
$Record = Get-DnsServerResourceRecord -ZoneName mydomain.local -Name mail -RRType CName
$NewRecord = $Record.Clone()
$NewRecord.RecordData.HostNameAlias = 'smtp.mydomain.com'
Set-DnsServerResourceRecord -ZoneName mydomain.local -OldInputObject $Record -NewInputObject $NewRecord