Skip to content

Instantly share code, notes, and snippets.

View MiffOttah's full-sized avatar

Miff MiffOttah

View GitHub Profile
class test {
public static void main(String[] args){
String poop = "💩";
System.out.println(poop.length());
}
}
#!/usr/bin/env python3
# coding: utf8
# emojiencoder.py3 by MiffTheFox <https://miffthefox.info/>
"""
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
bool IsUtf8Maybe(byte data){
byte bit7 = 1 << 7;
byte bit6 = 1 << 6;
int length = 0;
foreach (byte b in data){
if ((b & bit7) == 0){
if (length > 0){
return false;
}
@MiffOttah
MiffOttah / dagalatin.cs
Created October 16, 2017 16:08
dagalatin.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DagaDex
{
public static class DagaLatin
{
$settingsFile = Get-Item "C:\Steam\config\loginusers.vdf"
$steamExe = "C:\Steam\Steam.exe"
If (Test-Connection www.google.com -Count 1 -Quiet){
Write-Host "Online"
$settingsFile.Attributes="Archive"
Get-Content $settingsFile | `
%{$_ -replace "`"WantsOfflineMode`"`t`t`"1`"", "`"WantsOfflineMode`"`t`t`"0`""} | `
%{$_ -replace "`"SkipOfflineModeWarning`"`t`t`"1`"", "`"SkipOfflineModeWarning`"`t`t`"0`""} | `
Set-Content $settingsFile
@MiffOttah
MiffOttah / pastefile.js
Created November 26, 2017 22:56
This seems useful and not well documented.
document.onpaste = function (e) {
var items = (event.clipboardData || event.originalEvent.clipboardData);
if (items && items.files && items.files.length >= 0) {
fileSelector.files = items.files;
}
};
@MiffOttah
MiffOttah / fizzbuzz.cpp
Created October 24, 2018 04:06
I'm actually drunk right now
#include <iostream>
using namespace std;
int main ()
{
int D;
for (int i = 1; i <= 100; i++)
{
D = (i % 15) + 8;
if (8==D)
/*
Copyright 2018 MiffTheFox
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@MiffOttah
MiffOttah / PowerWrapper.cmd
Created December 24, 2018 23:51
Prepend this to a ps1 file and change the extension to cmd and you've magically bypassed Powershell Execution Policy. Perfect for new install scripts!
@ECHO OFF
:: Copyright © 2018 MiffTheFox
:: This work is free. You can redistribute it and/or modify it under the
:: terms of the Do What The Fuck You Want To Public License, Version 2,
:: as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
SET PS="%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe"
IF EXIST %PS% (
:: TODO: Pass arguments to the PowerShell script somehow.
%PS% -Command "$d = (gc '%~dpf0' -Raw); iex $d.Substring($d.IndexOf(' :' + ':') + 6)"
#!/bin/sh
REMOTE=`git config --get remote.origin.url`
REPO=`pwd`
cd ~
rm -rf "$REPO"
mkdir "$REPO"
cd "$REPO"
git clone $REMOTE .