Skip to content

Instantly share code, notes, and snippets.

@nganphant
nganphant / android <= max width
Last active December 3, 2022 06:22
Created with Copy to Gist
app:layout_constraintWidth_max="wrap"
app:layout_constraintWidth_percent="0.4"
https://stackoverflow.com/questions/49255147/constraintlayout-max-width-percentage
@nganphant
nganphant / README.md
Created August 9, 2022 11:24 — forked from moutend/README.md
[Swift] read and write WAV audio file with AVAudioFile

This script reads /tmp/input.wav and writes the copy of input as /tmp/output.wav.

$ swift main.swift
@nganphant
nganphant / README.md
Created June 29, 2022 08:00 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@nganphant
nganphant / Objective-C Code Snippets .h
Created January 17, 2022 12:03 — forked from slow-coding/Objective-C Code Snippets .h
An Objective-C class with useful macros and functions
//
// DZUtility.h
// Utility
//
// Created by Darren Zheng on 13-4-20.
// Copyright (c) 2013年 Darren Zheng. All rights reserved.
//
#import <Foundation/Foundation.h>
<?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>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleIdentifier</key>
<string>com.YourName.YourAppName</string>
<key>CFBundleVersion</key>
<string>1</string>
@nganphant
nganphant / __vsnwprintf_s c++.txt
Last active October 18, 2021 04:56
Created with Copy to Gist
unresolved external symbol __vsnwprintf_s referenced in function
There were a number of breaking changes in VS2015 documented here:
https://msdn.microsoft.com/en-us/library/bb531344.aspx
In particular, for undefined   __vsnwprintf_s
"The printf and scanf family of functions are now defined inline.                    
@nganphant
nganphant / DynamicType.m
Created September 1, 2020 07:19
Prevent Font Siu Bự
@interface MyApplication : UIApplication
@end
@implementation MyApplication
- (UIContentSizeCategory) preferredContentSizeCategory
{
return UIContentSizeCategoryLarge;
}
/**
Calculate initial compass bearing between two locations
- parameter fromLocation: Source Location
- parameter toLocation: Destination Location
- returns: bearing (CLLocationDirection)
*/
private func bearingFromLocation(fromLocation: CLLocation, toLocation: CLLocation) -> CLLocationDirection {
Moving files and folders
If you want to do a simple in-place rename of a file or folder, use Context Menu → Rename... Enter the new name for the item and you're done.
If you want to move files around inside your working copy, perhaps to a different sub-folder, use the right mouse drag-and-drop handler:
select the files or directories you want to move
right drag them to the new location inside the working copy
release the right mouse button
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}