Skip to content

Instantly share code, notes, and snippets.

View emilkje's full-sized avatar

Emil Kjelsrud emilkje

View GitHub Profile
@emilkje
emilkje / install.sh
Last active April 4, 2024 06:32
mock install
#!/bin/sh
echo "Installing inctl..."
# mock install with sleep 3
sleep 3
# set green color

Keybase proof

I hereby claim:

  • I am emilkje on github.
  • I am emilkje (https://keybase.io/emilkje) on keybase.
  • I have a public key ASC_pBea-5K-opSir0oUyu-UdEj9iZn68KhYPTaOkKXG8Qo

To claim this, I am signing this object:

using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace jsonconvert
{
class Program
{
static void Main(string[] args)
{
0x5B07976752E597651c447a95E7428fee275BBb66
[user]
name = Emil Kjelsrud
email = emil@innit.no
username = emilkje
[push]
default = simple
[alias]
ci = commit -m
cia = commit -am
timeline = log --oneline --graph --decorate
@emilkje
emilkje / wicon.php
Created September 11, 2011 16:02
Pulls current weather icon from Yahoo and displays it with alpha transparency
<?php
$url="http://weather.yahoo.com/norway/oppland-fylke/gjovik-858964/"; //Yahoo weather URL for you location
$file_contents = file_get_contents($url); //Fetching the contents from the url
$divStart = '<div class="forecast-icon" style="background:url(' . "'"; //HTML before weather image
$strEnd = "'); _background-image/* */: none;"; //HTML after weather image
//Preparing for image url extraction via substr()
$start = strpos($file_contents, $divStart) + 50;
$end = strpos($file_contents, $strEnd);