Skip to content

Instantly share code, notes, and snippets.

View ahmubashshir's full-sized avatar

Mubashshir ahmubashshir

View GitHub Profile
@ahmubashshir
ahmubashshir / .bash-powerline
Created February 25, 2019 11:31
Bash Powerline
#!/usr/bin/env bash
## Uncomment to disable git info
#POWERLINE_GIT=0
__powerline() {
# Colorscheme
readonly RESET='\[\033[m\]'
readonly COLOR_CWD='\[\033[0;34m\]' # blue
readonly COLOR_GIT='\[\033[0;36m\]' # cyan
@ahmubashshir
ahmubashshir / floyeds-turtle.vala
Created February 29, 2020 11:19
'Floyeds Turtle' implemented in vala
public int fdup(int[] val)
{
var trt = val[val[0]];
var hre = val[0];
var cntr = 0;
while (trt != hre)
{
if( ( cntr < val.length * 10 ) && ( val.length < 15) )
break;
trt = val[trt];
@ahmubashshir
ahmubashshir / ttm_unpack.c
Created March 13, 2020 05:24
To the Moon.rgssad extractor, forked from http://ancurio.bplaced.net/stuff/ttm_pack.c and edited...
/*
* ttm_unpack: An unpacker for the game "To the Moon"'s datafiles.
*
* Copyright (c) 2012, David Gow <david@ingeniumdigital.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
"Aoi" - Hikaru ga Chikyuu ni Itakoro......
10 Years after saying “Leave this to me and go”, I Became a Legend.
10 Years in the Friend Zone
2.5 Dimensional Seduction
A Boy Who Has Been Reincarnated Twice Spends Peacefully as an S-Rank Adventurer
A Fool and a Girl
A Pretty's Super Zombie
A Story About A Totally Straightforward Girlfriend
A Story About Treating a Female Knight Who Has Never Been Treated as a Woman as a Woman
Aida ni Hatachi
/*
*
* Copyright 2019 Ahmad Hasan Mubashshir <ahmubashshir@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
/*
*
* Copyright Ahmad Hasan Mubashshir <ahmubashshir@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
#!/usr/bin/python3
##### sync_to_async def
import os
import sys
import threading
import gi, platform, subprocess
gi.require_version('WebKit', '3.0')
gi.require_version('Gtk', '3.0')
#include<stdio.h>
int main()
{
char ch='\0';
scanf("%c",&ch);
printf("%d\n",(int)ch);
return 0;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><!--# echo var="status_type" default="" -->: <!--# echo var="status" default="" --></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--# if expr="$status = 502" -->
<meta http-equiv="refresh" content="2">
<!--# endif -->
</head>
#!/bin/bash
stat="$(cut -c1 </sys/class/power_supply/BAT0/status)"
full="$(</sys/class/power_supply/BAT0/charge_full)"
current="$(</sys/class/power_supply/BAT0/charge_now)"
percent="$(echo "($current*100)/$full"|bc)"
if [[ $stat = C ]];then
CHR="" # fas fa-battery-bolt ei character ta copy koro
else
CHR=" "
fi