Skip to content

Instantly share code, notes, and snippets.

View ArtikusHG's full-sized avatar

ArtikusHG

View GitHub Profile
@ArtikusHG
ArtikusHG / gist:1e18101edbcd10038b1239e0855bb810
Created December 5, 2019 16:32 — forked from patrickgalbraith/gist:9538b85546b4e3841864
Javascript dynamic getter, setter using defineProperty
var User = (function () {
function User (id, nam) {
var self = this;
this.id = id;
this.nam = nam;
this.__data = {};
for(var p in self) {
#!/bin/bash
# Get the song that is currently played and store it to a variable
oldsong=$(mpc current)
# Stays on loop while the script is active
while "true"; do
# Check if the current song is equal to the one that was playing before (oldsong)
if [[ "$(mpc current)" != "$oldsong" ]]; then
# If not equal, assign the new song to the variable to be checking again correctly
oldsong=$(mpc current)
# And send the notification
<html>
<head>
<title>A game</title>
<script>
var width;
var height;
function getScreenSize() {
width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
height -= 110;
@ArtikusHG
ArtikusHG / PaperStoneAndScissors.py
Created April 28, 2018 10:07
The teacher told me I can get an additional A+...
import random
objects = ["Paper", "Scissors", "Stone", "Magma"]
playerScore = 0
aiScore = 0
magmaWasted = False
def whoWins(player):
global playerScore
global aiScore
@ArtikusHG
ArtikusHG / SBSharedInstance.xm
Created August 24, 2017 13:32
Adding a sharedInstance to the SpringBoard so you can call methods from it (with an example of calling a method).
// Needed interface which includes the sharedInstance, and a void for the example
@interface SpringBoard
+ (id)sharedInstance;
- (void)_simulateHomeButtonPress;
@end
%hook SpringBoard
// We create the sharedInstance. It's empty for now, so we ake it useful in the next methods
// P.S. I wanted to make a __weak, but it didn't compile, and a __strong magically worked
static SpringBoard *__strong sharedInstance;
// Just make the sharedInstance the same thing as init
@ArtikusHG
ArtikusHG / NoPressHomeToUnlock.xm
Created July 16, 2017 09:47
No press home to unlock on lockscreen. Theos tweak.
%hook SBDashBoardMainPageView
-(void)_layoutCallToActionLabel {}
%end
@ArtikusHG
ArtikusHG / NoDockBackground.xm
Created July 16, 2017 09:45
No dock background for iOS. Theos tweak.
%hook SBDockView
-(void)setBackgroundAlpha:(double)arg1 {
%orig(0.0);
}
%end
@ArtikusHG
ArtikusHG / NoFolderRemoval.xm
Last active July 16, 2017 09:43
Don't remove folders. Theos tweak.
%hook SBFolder
-(BOOL)shouldRemoveWhenEmpty {
return NO;
}
%end
@ArtikusHG
ArtikusHG / StoPetya.bat
Last active June 29, 2017 06:23 — forked from ujeenator/stop-petya.bat
A simple batch script to stop the petya ransomware from encrypting files.
@echo off
cls
color 02
echo Welcome to StoPetya!
echo Please make sure you're running this script with admin rights.
echo Press any key to fix the petya ransomware...
pause >NUL
color 04
cls
echo Deleting fies...