This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
# codesigning and provisioning profile should be configured using Xcode | |
PROJECT=<your project name> | |
SCHEME=${PROJECT} # Setting project name as the default scheme. Update based on your scheme | |
ARCHIVEPATH=`pwd`/archive | |
IPA_NAME=${PROJECT} | |
PROJECT_BUILDDIR=${ARCHIVEPATH}/${IPA_NAME}.xcarchive/Products/Applications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#zsh | |
brew list | while read cask; do echo -n "\e[1;34m$cask ->\e[0m"; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ""; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert <your.pem> -key <your.pem> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git-revert $ git init | |
git-revert (master) $ touch 1.txt | |
git-revert (master) $ touch 2.txt | |
git-revert (master) $ git add . | |
git-revert (master) $ git commit -am "wanted commit 1" | |
[master (root-commit) 80395aa] wanted commit 1 | |
2 files changed, 0 insertions(+), 0 deletions(-) | |
create mode 100644 1.txt | |
create mode 100644 2.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Convert from dos/unix to unix | |
#To convert from any mixture of CRLF endings and LF-only endings, to LF-only endings:[C 1] | |
:set hidden #Allow modified buffers to be hidden. | |
:set ffs=dos #Assume dos line endings (CRLF or LF-only) when reading files. | |
:args *.c *.h #Specify the files to convert. | |
:argdo set ff=unix|w #For each argument, set unix file format for the buffer, and write the file.[C 2] | |
#Convert from dos/unix to dos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change the headefile for Windows | |
#include <memory> | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#pragma comment(lib,"Ws2_32.lib"); | |
#include <string> | |
using namespace std; | |
// This is compatible with old version of Windows. | |
bool IsIPAddress(const string& value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Reset the modifications | |
git checkout -- <filename> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MemoryInfo | |
{ | |
[DllImport("psapi.dll", SetLastError = true)] | |
[return: MarshalAs(UnmanagedType.Bool)] | |
public static extern bool GetPerformanceInfo([Out] out PerformanceInformation PerformanceInformation, [In] int Size); | |
[StructLayout(LayoutKind.Sequential)] | |
public struct PerformanceInformation | |
{ | |
public int Size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void radix_sort(unsigned *begin, unsigned *end) | |
{ | |
unsigned *begin1 = new unsigned[end - begin]; | |
unsigned *end1 = begin1 + (end - begin); | |
for (unsigned shift = 0; shift < 32; shift += 8) { | |
size_t count[0x100] = {}; | |
for (unsigned *p = begin; p != end; p++) | |
count[(*p >> shift) & 0xFF]++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Management; | |
using System.Security.Principal; | |
using Microsoft.Win32; | |
public class SysInfoHelper | |
{ | |
public static void LogSystemInfo(int messageID) | |
{ | |
LogOSVersionInfo(messageID); | |
LogUserInfo(messageID); |