Skip to content

Instantly share code, notes, and snippets.

View RayPS's full-sized avatar
🏠
Working from home

Ray RayPS

🏠
Working from home
View GitHub Profile
@p2or
p2or / Blender_Basic-UI-Template_27.py
Last active January 22, 2024 19:03
Basic-UI-Template for Blender 2.7+ #Blender #BSE
# -> For a Blender 2.8+ version, go to https://gist.github.com/p2or/2947b1aa89141caae182526a8fc2bc5a
# https://blender.stackexchange.com/q/57306/3710, https://blender.stackexchange.com/q/79779/3710
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
@RayPS
RayPS / Framer-Design-At-1x.coffee
Last active March 4, 2018 13:04
Framer Design At 1x
is_iPhone = Framer.Device.deviceType.includes "apple-iphone"
is_iPhonePlus = Framer.Device.deviceType.includes "plus"
is_iPhoneNotPlus = is_iPhone and not is_iPhonePlus
if is_iPhonePlus and Utils.isFramerStudio() then Framer.Device.content.scale = 3
if is_iPhoneNotPlus and Utils.isFramerStudio() then Framer.Device.content.scale = 2
document.querySelector("head>meta[name=viewport]").setAttribute "content",
"width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no"
Framer.Device._update()
@steipete
steipete / ios-xcode-device-support.sh
Last active October 14, 2024 16:35
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@iandundas
iandundas / String+emoji.swift
Last active April 23, 2022 16:30
Random Emoji
// Returns a random Emoji 🌿
extension String{
func randomEmoji()->String{
let range = 0x1F601...0x1F64F
let ascii = range.startIndex + Int(arc4random_uniform(UInt32(range.count)))
let emoji = String(UnicodeScalar(ascii))
return emoji
}
}
@wong2
wong2 / cmds.txt
Last active May 2, 2021 12:13
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@paulirish
paulirish / bling.js
Last active November 4, 2024 17:48
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@BelinChung
BelinChung / ua.js
Last active August 29, 2015 14:03
Mobile UA detection library.You can access device object which contains useful information about device and platform.
var device = (function () {
var device = {};
var ua = navigator.userAgent;
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
device.ios = device.android = device.iphone = device.ipad = false;
@koenbok
koenbok / qc-framer.js
Created May 14, 2014 15:04
QC Spring Value Converter
var QcValueConverter = {
tensionFromQcValue: function(qcValue) {
return (qcValue - 30.0) * 3.62 + 194.0;
},
qcValueFromTension: function(tension) {
return (tension - 194.0) / 3.62 + 30.0;
},
frictionFromQcValue: function(qcValue) {