Skip to content

Instantly share code, notes, and snippets.

View tdamdouni's full-sized avatar

Taha Dhiaeddine Amdouni tdamdouni

View GitHub Profile
@kharrison
kharrison / String.swift
Last active January 22, 2024 14:03
Swift String Playground Examples
// Swift Standard Librray - String
// Keith Harrison http://useyourloaf.com
// Import Foundation if you want to bridge to NSString
import Foundation
// ====
// Initializing a String
// ====
# coding: utf-8
# Stub generator for ui module
# NOTES:
# * For classes, the base class is always assumed to be `object`. This isn't correct, but it shouldn't matter much because the
# generated stubs also contain inherited methods and data descriptors. Using the actual base classes would complicate things a
# little because the class definitions would have to appear in the correct order then.
# * It's not possible to get correct argspecs for functions and methods that are implemented in C, so they're always just
# `self, *args` (for bound methods) or `*args*` (for module-level functions) in the output.
import ui
@hamzasood
hamzasood / gist:02e6e87835a17f4e1b9e
Created November 23, 2015 23:15
Apple Pencil 3D Touch
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
// Hook with ObjC runtime functions
%config(generator=internal)
// New methods created below
@interface UIGestureRecognizer ()
+ (void)hs_beginForcingAllNewGestureRecognizersToAllowPencilInput;
+ (void)hs_endForcingAllNewGestureRecognizersToAllowPencilInput;
@b00gizm
b00gizm / MobileBlogger.py
Created November 18, 2015 14:34
MobileBlogger.py
# coding: utf-8
import appex
import console
import keychain
import dialogs
import re
from pygithub3 import Github
from gpiozero import LED, MotionSensor, LightSensor
from signal import pause
pir = MotionSensor(21)
ldr = LightSensor(26)
light = LED(25)
def daytime():
pir.when_motion = None
pir.when_no_motion = None
light.off()
def nighttime():
Project # of Top 100 Free Apps (US)
facebook-ios-sdk 67
Bolts-iOS 48
AFNetworking 39
Google-Mobile-Ads-SDK 38
Reachability (Apple) 38
Crashlytics 37
Flurry-iOS-SDK 31
CocoaPods 30
GoogleConversionTracking 29
@blmacbeth
blmacbeth / ProgressView.py
Created September 19, 2015 20:08
ProgressView.py
# coding: utf-8
from objc_util import *
## this is bad python styling, but I justify it by saying the
## function is an alias for the UIColor class
def UIColor(red=1.0, green=1.0, blue=1.0, alpha=1.0):
UIColor = ObjCClass('UIColor')
r = CGFloat(red)
g = CGFloat(green)
@omz
omz / CodeEditor Demo.py
Created July 28, 2015 22:18
CodeEditor Demo.py
# coding: utf-8
'''
NOTE: This requires the latest beta of Pythonista 1.6 (build 160022)
Demo of using Pythonista's own internals to implement an editor view with syntax highlighting (basically the exact same view Pythonista uses itself)
IMPORTANT: This is just for fun -- I was curious if it would work at all, but I don't recommend that you rely on this for anything important. The way Pythonista's internals work can change at any time, and this code is *very* likely to break in the future.
'''
import ui
@Gadgetoid
Gadgetoid / ExplorerHat.md
Last active May 31, 2018 22:45
Explorer HAT, Motors, Steppers and Servos

#Explorer HAT Pro, Motors, Servos and Steppers

Find this Gist at: tiny.cc/explorerhat

The Motor driver on Explorer HAT Pro can not only drive motors, but a stepper motor too. And just like the Pibrella the outputs can also drive a motor or four, or another stepper.

Explorer HATs outputs sink to ground, meaning that you need to connect whatever you're driving between 5V and the output

#MOTORS