Skip to content

Instantly share code, notes, and snippets.

@Kyngo
Kyngo / xboxwol.js
Created January 9, 2021 22:16
Boot an Xbox via LAN
#!/usr/bin/env node
/**
* This script crafts a magic packet for an Xbox One to boot up from the network.
* This has been tested on an Xbox One X in a sleeping state,
* it might not work if the console is totally powered off.
* No dependencies needed, just copy the script and off you go.
* You're free to use this as you wish, but consider mentioning me in your project's credits :)
*
* Example usage: ./xboxwol.js --ip=192.168.254.100 --liveid=F12345ABCDE12ABX
@ditzel
ditzel / KdTree.cs
Last active April 29, 2024 21:38
k-d Tree
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
public class KdTree<T> : IEnumerable<T>, IEnumerable where T : Component
{
protected KdNode _root;
protected KdNode _last;
@reidscarboro
reidscarboro / LoadingDots.cs
Created May 10, 2017 13:29
Bouncing loading dots in Unity using DoTween
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class LoadingDots : MonoBehaviour {
//the total time of the animation
public float repeatTime = 1;
//the time for a dot to bounce up and come back down
override func viewDidLoad() {
super.viewDidLoad()
setText()
NSNotificationCenter.defaultCenter().addObserver(self, selector: "setText", name: LCLLanguageChangeNotification, object: nil)
}
@IBAction func IndexChanged(sender: UISegmentedControl) {
let language: String
switch self.LangChoser.selectedSegmentIndex
{
@marcboeren
marcboeren / 1.UIStoryboardSegueFromRight.swift
Created March 19, 2015 20:02
Segue from Right (Slide the next controllers view in from right to left (and back))
import UIKit
class UIStoryboardSegueFromRight: UIStoryboardSegue {
override func perform()
{
let src = self.sourceViewController as UIViewController
let dst = self.destinationViewController as UIViewController
src.view.superview?.insertSubview(dst.view, aboveSubview: src.view)
@unity3diy
unity3diy / unity 2d camera follow
Last active January 15, 2024 18:05
unity 2d camera follow script, add this script to camera and drag character or your object into it. simple!
using UnityEngine;
using System.Collections;
public class FollowCamera : MonoBehaviour {
public float interpVelocity;
public float minDistance;
public float followDistance;
public GameObject target;
public Vector3 offset;
@NovaSurfer
NovaSurfer / FadeInOut.cs
Last active February 5, 2022 15:59
Unity3D screen fading script (using new UI)
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.SceneManagement;
public class ScreenFader : MonoBehaviour
{
public Image FadeImg;
public float fadeSpeed = 1.5f;
public bool sceneStarting = true;
@zetachang
zetachang / gist:4111314
Created November 19, 2012 15:37
Instruction on adding a Acknowledgements Settings.bundle
  • To add Settings.bundle in Xcode. Command N and in Resource, choose Settings Bundle .
  • Open Root.plist in source code, paste the code below to replace it,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>PreferenceSpecifiers</key>
	
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 9, 2024 10:28
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S