Skip to content

Instantly share code, notes, and snippets.

View M4cs's full-sized avatar

Max Bridgland M4cs

View GitHub Profile
@M4cs
M4cs / twitterinfo.py
Created November 26, 2018 04:53
Twitter Info Grabber
def checkconfig():
from configparser import ConfigParser
import cfg
config = ConfigParser()
config.read('config.ini')
if config['DEFAULT'] == {}:
cfg.addtwitter()
else:
tack = config['DEFAULT']['twitter_api_consumer_key']
tacs = config['DEFAULT']['twitter_api_consumer_secret']
@M4cs
M4cs / CatList.js
Last active January 22, 2019 16:39
import React, { Component } from 'react';
import { FlatList } from 'react-native';
import styled from 'styled-components';
const Header = styled.Text`
color: white;
font-size: 24;
`;
const CatItem = styled.Text`
%hook UIWindow
-(void)layoutSubviews {
%orig;
[self setClipsToBounds:YES];
[self.layer setCornerRadius:25.0f];
CAGradientLayer *gradient = [CAGradientLayer layer];
CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
self.layer.cornerRadius = 25.0f;
self.layer.shadowColor = [UIColor blueColor].CGColor;
@M4cs
M4cs / 422.png
Last active July 21, 2020 13:05
My Site
422.png
@M4cs
M4cs / WakaTime.md
Last active June 26, 2019 13:48
My Coding Activity

Coding Activity

echo "alias uicache='sudo rm -rfv /Library/Caches/com.apple.iconservices.store >> /dev/null; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \ >> /dev/null; ; sleep 3;sudo touch /Applications/* >> /dev/null; killall Dock; killall Finder; echo Cache Refreshed;'" >> ~/.zshrc
@M4cs
M4cs / download_bins.sh
Last active August 5, 2019 15:23
mti-cli setup scripts
curl -s https://macthemes.co/install-mti.sh | sudo sh
@M4cs
M4cs / using_mti
Last active August 1, 2019 04:15
MTI
cd <PATH_TO_BUNDLE_ROOT>
ls
# expect bundle to be shown in output
sudo easy_mount
sudo mti-cli -i -t <THEME_BUNDLE_NAME>.bundle
# TO UNINSTALL
sudo mti-cli -u -t <THEME_BUNDLE_NAME>.bundle
@M4cs
M4cs / istats.py
Last active March 23, 2024 20:32
Getting iStats Widget
import os
import time
import subprocess
while True:
output = subprocess.check_output(['istats', 'cpu'])
output1 = subprocess.check_output(['istats', 'fan'])
output2 = subprocess.check_output(['istats', 'battery'])
new_output = '\n\n\n' + str(output.decode('utf-8')) + '\n' + str(output1.decode('utf-8')) + '\n' + str(output2.decode('utf-8'))
print(new_output.replace('For more stats run `istats extra` and follow the instructions.', ''))
@M4cs
M4cs / check_email.py
Created December 19, 2019 20:35
Email Validator
# On Python3 run: `pip3 install dnspython`
import dns.resolver
import re
def verify_email(email):
regex = '^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$'
if re.search(regex,email):
pass
else: