Skip to content

Instantly share code, notes, and snippets.

View CheeryLee's full-sized avatar
🚙
wroom wroom

Alexander Pluzhnikov CheeryLee

🚙
wroom wroom
  • PlayFlock
  • Moscow, Russia
View GitHub Profile
@Luoyayu
Luoyayu / gist:3c5f099dd1a453f049fced1df7bc7964
Created December 12, 2019 18:48
extract Xcode.xip to a customed volume
By default, when extracts the Xcode.zip,
macos will create tmp file in `/private/var/folders/v2/tbmrn60d2910x3w23ys5fgs00000gn/T/com.apple.AUHelperService`.
Sometimes, the /private has no ehough space to hold 19GB Xcode.app.
Thus we can create a soft link named `com.apple.AUHelperService` in the tmp dir.
Steps:
1. BACKUP `com.apple.AUHelperService` in `/private/var/folders/v2/tbmrn60d2910x3w23ys5fgs00000gn/T/` to `com.apple.AUHelperService_BACKUP`
2. mkdir named `com.apple.AUHelperService` wherever you have enough space,
3. ln -s /your/absolute/path/com.apple.AUHelperService /private/var/folders/v2/tbmrn60d2910x3w23ys5fgs00000gn/T
4. double click the Xcode.xip
@KRostyslav
KRostyslav / tsconfig.json
Last active June 23, 2024 17:44
tsconfig.json с комментариями.
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
@tomasevich
tomasevich / nginx_nodejs.md
Last active June 22, 2024 19:20
Сервер в связке Nginx + NodeJs

Сервер в связке Nginx + NodeJs

Данная пошаговая инструкция поможет освоить основы на простом примере

Для справки

Сервер поднимался на Debian 8 c характеристиками:

CPU - 1 ядро x 500 МГц

@olssonm
olssonm / macos-disable-resize
Last active June 8, 2024 18:02
Disable resizing of the macOS dock
defaults write com.apple.dock size-immutable -bool true; killall Dock
@jhazelwo
jhazelwo / iptables.sh
Last active March 5, 2024 02:52
iptables rules to only allow VPN traffic AND let user SSH to VPN server itself.
#!/bin/sh
# by: "John Hazelwood" <jhazelwo@users.noreply.github.com>
#
# iptables rules to only allow VPN traffic AND let user SSH to VPN server itself.
# Use this on a CentOS/RedHat server you have set up to be a NAT firewall for your network.
# This will force ALL Internet traffic to go over the VPN
# and will BLOCK ALL Internet TRAFFIC if VPN is not running!
#
# use `service iptables save` to save the rules to /etc/sysconfig/iptables
# made
@unitycoder
unitycoder / if-branchless.shader
Last active April 3, 2024 11:20
Avoiding Branching / Conditionals in Shaders Fast No If
"The common wisdom of "don't use conditionals in shaders" is one of my biggest frustrations with how shaders are taught.
step(y, x) _is_ a conditional! It compiles to identical code as:
float val = (x >= y ? 1.0 : 0.0)
or
float val = 0.0;
if (x >= y) val = 1.0;"
https://twitter.com/bgolus/status/1235254923819802626
// Performing shader divisions without diving *rcp = approximation of 1/x
float myDividedVal = myValToDivide * rcp(myDivider);
@benvium
benvium / apk-change-version-number.md
Created February 20, 2015 16:14
How to change the version number on an existing APK without re-building

This requires the latest version of apktool.

apktool d $APK_PATH -o $OUTPUT_FOLDER

# Open the apktool.yml text file
# Alter the versionCode and versionName entries

# now rebuild!
apktool build $OUTPUT_FOLDER 
@davidfowl
davidfowl / dotnetlayout.md
Last active July 4, 2024 01:57
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@aVolpe
aVolpe / Vibration.cs
Created October 16, 2014 02:45
Vibration for Unity3d with Android native Call, with fallback to Handlheld.Vibrate()
using UnityEngine;
using System.Collections;
public static class Vibration
{
#if UNITY_ANDROID && !UNITY_EDITOR
public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator");
@stanroze
stanroze / SimpleAsyncHost.cs
Created April 17, 2014 20:12
Simple async HttpListener implementation.
public class SimpleAsyncHost
{
private HttpListener _httpListener;
private bool _stop;
public SimpleAsyncHost()
{
_httpListener = new HttpListener();
_httpListener.Prefixes.Add("http://localhost:10090/");