Skip to content

Instantly share code, notes, and snippets.

View myrkvi's full-sized avatar

Vegard Berg myrkvi

View GitHub Profile
@myrkvi
myrkvi / Hello World.md
Created October 5, 2012 22:11
Testing.

Hello, and welcome to this world.

Hola worldita!

using System;

class Main {
 private static void main(String[] args) {
@myrkvi
myrkvi / gist:3941577
Created October 23, 2012 21:10 — forked from Dinnerbone/gist:3736487
New Minecraft target selector syntax!

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax a=0. For example, @p[a=0,b=5,c=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

  • x - X coordinate for search center. Default is senders coordinate, or 0.
  • y - Y coordinate for search center. Default is senders coordinate, or 0.
@myrkvi
myrkvi / mco.bat
Created January 26, 2013 13:40
An offline launcher for Minecraft written in Batch.
@echo off
IF "%1" == "-jar" goto file_not_exists ::If the argument -jar is added, you can set a new minecraft.jar.
IF EXIST "%APPDATA%\jar" goto file_exists
IF NOT EXIST "%APPDATA%\jar" goto file_not_exists
:file_exists ::If a previous config is found, it will just ask for the username.
set /p JAR=<"%APPDATA%\jar"
set /p uname="Username: "
java -Xincgc -Xmx1024m -cp "%APPDATA%\.minecraft\bin\%JAR%;%APPDATA%\.minecraft\bin\lwjgl.jar;%APPDATA%\.minecraft\bin\lwjgl_util.jar;%APPDATA%\.minecraft\bin\jinput.jar" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft "%uname%"
@myrkvi
myrkvi / gist:5866777
Created June 26, 2013 11:41
Haskell test
module Main where
import Prelude
import System.Random
adj = ["funny", "soft", "neat", "tasteful", "aerodynamic", "smooth", "hard", "circle-shaped", "tiny", "long", "hairy", "adorable", "bloody", "clean", "dark", "elegant", "fancy", "filthy", "gorgeus", "light", "motionless", "plain", "shiny", "sparkling", "ugly", "unusual", "breakable", "busy", "concerned", "dead", "different", "fragile", "helpless", "anxious", "bad", "awful", "clumsy", "envious", "foolish", "grumpy", "jealous", "nervous", "scary", "terrible", "thoughtless", "wicked"]
noun = ["cat", "dog", "chair", "couch", "door", "pet", "human", "car", "refridgerator", "television", "napkin", "book", "cellphone", "man", "mountain", "house", "photograph", "movie", "train", "country", "clock", "pen", "milk", "water", "waiter", "sock", "monkey"]
creative = [a ++ " " ++ n | a <- adj, n <- noun]
cl = (length creative) - 1
@myrkvi
myrkvi / primes.py
Last active January 2, 2016 02:18
Prime numbers and shit.
from time import clock
import sys
def percentageCompleted(cur, tot):
p = (cur + .0) / (tot + .0) * 100
return "%.2f" % p
def isPrime(num):
if num <= 1:
for i, j in zip(range(0, 100, 1), range(0, 200, 2)):
print("variable 'i' is: %i" % i)
print("variable 'j' is: %i" % j)
# -*- coding: utf-8 -*-
import sys
alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅabcdefghijklmnopqrstuvwxyzæøå .,:;!?"
def encodeString(ab, sTE, sec):
finalString = ""
for x in sTE:
pos = ab.find(x)
from turtle import *
def configureTurtle():
colormode(255)
hideturtle()
delay(1)
speed(0)
def isPrime(n):
if n <= 0:
return False
elif n == 1:
return False
elif n == 2:
return True
else:
for x in range(2, (n // 2) + 1 ):
if (n % x) == 0:
#lang racket
(define max (expt 100 100))
(define out (open-output-file "eee.txt"))
(define (f a b)
(if (> b max)
(f 0 1)