Skip to content

Instantly share code, notes, and snippets.

View faejr's full-sized avatar
🌱
Compassionate

fae faejr

🌱
Compassionate
View GitHub Profile

Keybase proof

I hereby claim:

  • I am LiljebergXYZ on github.
  • I am danl (https://keybase.io/danl) on keybase.
  • I have a public key whose fingerprint is 573E FC65 89C4 7AB6 385C B9E4 D1E8 1B72 B0C4 DFFD

To claim this, I am signing this object:

<?php
// Gets indiivudal objects from a json string
// By checking for opening and closing brackets
// While ensuring they're all the same size
// - Daniel L. 2017-12-14
function getObject($stream) {
$openbrackets = 0;
$closedbrackets = 0;
$instr = false;
$startPos = 0;
@faejr
faejr / database.php
Last active April 19, 2018 09:25
idk
<?php
abstract class Database
{
protected $db;
protected $query;
protected $values = [];
public function __construct($dbname, $host, $username, $password) { }
@faejr
faejr / vhostmgr
Last active December 29, 2016 15:10
Virtual host manager (Intended for CloudLinux)
#!/bin/bash
#
# Intended for use with CloudLinux
#
action=$1
domain=$2
siteConfigs='/etc/httpd/conf.d/'
sitesAvailableDomain=$siteConfigs$domain.conf
if [ "$(whoami)" != 'root' ]; then
@faejr
faejr / LightWakeup.py
Created September 28, 2016 07:30
LightWakeup
import pygame, sys
from pygame import *
pygame.init()
DONE = False
#Create a displace surface object
screen = pygame.display.set_mode((800, 600), FULLSCREEN)
@faejr
faejr / Viaplay.cs
Created June 13, 2016 12:35
Interfacing with viaplay content api
using System;
using System.Net;
using Nimble.JSON;
using System.Text.RegularExpressions;
using System.Collections.Generic;
namespace Viaplay
{
public class Viaplay
{
@faejr
faejr / dev-tmux
Last active May 29, 2016 17:28
Restores or create a new tmux development environment (4 panes)
#!/bin/bash
SESSIONS=$(tmux ls)
RESTORED=false
IFS=':' read -ra SES <<< "$SESSIONS"
if [ ${#SES} != 0 ]; then
for i in "${SES[@]}"; do
if [ "$i" = "dev" ]; then
RESTORED=true
tmux a -t "$i"
fi
@faejr
faejr / UploadNative.cs
Last active April 6, 2016 16:04
Basic function to handle file uploads using xamarin.mac
//Upload function using the native functionality of Mac
public static string UploadNative (string url, byte [] paramFileBytes, string fileFormName, Dictionary<string, string> args)
{
NSData actualFile = NSData.FromArray (paramFileBytes);
NSString urlString = (NSString)url;
//we're gonna send byte data
NSMutableUrlRequest request = new NSMutableUrlRequest ();
request.Url = new NSUrl(urlString);
request.HttpMethod = "POST";
string boundary = "---------------------------14737809831466499882746641449";
@faejr
faejr / keybase.md
Last active October 18, 2015 19:05

Keybase proof

I hereby claim:

  • I am LiljebergXYZ on github.
  • I am danl (https://keybase.io/danl) on keybase.
  • I have a public key whose fingerprint is 9B50 4087 A60A E874 52F7 EFB1 129A CB22 3466 3C5E

To claim this, I am signing this object: