Skip to content

Instantly share code, notes, and snippets.

@Noiled
Noiled / Connectivity.java
Created November 25, 2015 03:37 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
package com.emil.android.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author emil http://stackoverflow.com/users/220710/emil
@Noiled
Noiled / gist:cb780af83eebc2cbaa262a638f191f8c
Created April 26, 2016 13:06 — forked from ka010/gist:235253db3fccfac53910
Convert an AVFrame to CVPixelbuffer
-(void)getPixelBuffer:(CVPixelBufferRef *)pbuf {
@synchronized (self) {
if(!_pFrame || !_pFrame->data[0])
return;
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
// [NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey,
// [NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey,
@(_pFrame->linesize[0]), kCVPixelBufferBytesPerRowAlignmentKey,
@Noiled
Noiled / NSWeakTimer.m
Last active May 29, 2016 06:07 — forked from bendytree/NSWeakTimer.m
A starting point for an NSTimer that has a weak reference to its target. ARC only.
//
// NSWeakTimer.m
#import "NSWeakTimer.h"
@interface NSWeakTimerTarget : NSObject
@property (weak) id target;
@property (assign) SEL selector;
@property (assign) NSTimer* timer;
#!/bin/sh
# directories
SOURCE="ffmpeg"
FAT="build-iOS"
SCRATCH="scratch"
# must be an absolute path
THIN=`pwd`/"thin"
echo "install gas-preproccesor.pr"
git clone git://github.com/mansr/gas-preprocessor.git
echo "copy gas-preprocessor.pl to /usr/sbin"
sudo cp -f gas-preprocessor/gas-preprocessor.pl /usr/sbin/
echo "set execute right"
chmod +x /usr/sbin/gas-preprocessor.pl
echo "install finished."
//
// CapoPlaybackButton.h
// Capo
//
// Created by Christopher Liscio on 9/22/10.
// Copyright (c) 2010 SuperMegaUltraGroovy. All rights reserved.
//
#import <UIKit/UIKit.h>
(NSString *) CreateTypeStringWithOSType(OSType inType); // ;-)
@Noiled
Noiled / ImageHelper.h
Created August 10, 2018 14:39 — forked from PaulSolt/ImageHelper.h
A simple UIImage to RGBA8 conversion function
/*
* The MIT License
*
* Copyright (c) 2011 Paul Solt, PaulSolt@gmail.com
*
* https://github.com/PaulSolt/UIImage-Conversion/blob/master/MITLicense.txt
*
*/
#import <Foundation/Foundation.h>
@Noiled
Noiled / atomic.h
Created December 4, 2019 10:07 — forked from aprell/atomic.h
Atomic read/write
#ifndef ATOMIC_H
#define ATOMIC_H
// Adapted from http://golubenco.org/2007/06/14/atomic-operations
/**
* @brief Atomic type
*/
typedef int atomic_t;
@Noiled
Noiled / add-git-aliases.sh
Created October 11, 2021 02:31 — forked from ifduyue/add-git-aliases.sh
git aliases
#!/bin/bash
set -x
# common shortcuts
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.rb rebase