Skip to content

Instantly share code, notes, and snippets.

View shukob's full-sized avatar
🏊‍♂️

Shumpei Kobayashi shukob

🏊‍♂️
View GitHub Profile
@intere
intere / post-archive-script.sh
Last active February 11, 2019 14:56
@macbellingrath pointed out that Xcode 10 had a change and line 80 needed to be updated.
#################################################################################################################################################
# post-archive-script.sh
#
# The purpose of this script is to create a universal binary for your framework
# Also - if there is a problem with steps in this script, then it should be
# easy to debug! Other scripts that this is based off of aren't so easy to debug.
#
#################################################################################################################################################
import UIKit
import ImageIO
extension CGImagePropertyOrientation {
/**
Converts a `UIImageOrientation` to a corresponding
`CGImagePropertyOrientation`. The cases for each
orientation are represented by different raw values.
- Tag: ConvertOrientation
@wchargin
wchargin / extract_scalars.py
Created November 13, 2017 16:09
Extract scalars to CSV using the TensorBoard event multiplexer API
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import errno
import os
import re
@TestSubjector
TestSubjector / Blockchain.jl
Last active August 12, 2024 06:27
A very basic implementation of a blockchain in Julia.
using SHA
using Dates
"""
An individual block structure
"""
struct Block
index::Int
timestamp::DateTime
data::String
previous_hash::String
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 14, 2025 05:30
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@cotkjaer
cotkjaer / CGRect+Center.swift
Last active November 23, 2023 06:15
Swift extensions to add "center" to CGRect
extension CGRect
{
/** Creates a rectangle with the given center and dimensions
- parameter center: The center of the new rectangle
- parameter size: The dimensions of the new rectangle
*/
init(center: CGPoint, size: CGSize)
{
self.init(x: center.x - size.width / 2, y: center.y - size.height / 2, width: size.width, height: size.height)
@Yousha
Yousha / .gitignore
Last active June 12, 2025 09:02
.gitignore for PHP developers.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@robjperez
robjperez / test.c
Last active January 12, 2022 11:46
scale a nv21 frame
int ystride = width;
int uvstride = ((width + 1) / 2) * 2;
uint8_t* yplane = (uint8_t *)cameraFrame;
uint8_t * uvplane = (uint8_t *)cameraFrame + (width * height);
uint8_t *newy = (uint8_t*)malloc(sizeof(uint8_t) * width * height);
uint8_t *newu = (uint8_t*)malloc(sizeof(uint8_t) * width * height / 4);
uint8_t *newv = (uint8_t*)malloc(sizeof(uint8_t) * width * height / 4);
int newuvstride = (width +1 ) / 2;
@simonbromberg
simonbromberg / ListFonts.m
Last active September 6, 2023 03:35
List all fonts available on iOS device in console
// List all fonts on iPhone
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
for (NSString *family in familyNames) {
NSLog(@"Family name: %@", family);
fontNames = [UIFont fontNamesForFamilyName: family];
for (NSString *font in fontNames) {
NSLog(@" Font name: %@", font);
}
@bitnenfer
bitnenfer / websocket-server-winsock.cpp
Created December 29, 2016 05:02
WebSocket Server using WinSock2 and gaius engine.
void socket_run(void*)
{
//addrinfo hints;
//addrinfo* result = NULL;
//addrinfo* pointer = NULL;
uint32 success = 0;
SOCKET listen_socket = INVALID_SOCKET;
SOCKET client_socket = INVALID_SOCKET;
WSADATA wsa_data;