Skip to content

Instantly share code, notes, and snippets.

View rafattouqir's full-sized avatar

MD Rafat Touqir rafattouqir

View GitHub Profile
CIAdditionCompositing - Adds color components to achieve a brightening effect. This filter is typically used to add highlights and lens flare effects.
CIAffineClamp - Performs an affine transform on a source image and then clamps the pixels at the edge of the transformed image, extending them outwards. This filter performs similarly to the CIAffineTransform filter except that it produces an image with infinite extent. You can use this filter when you need to blur an image but you want to avoid a soft, black fringe along the edges.
CIAffineTile - Applies an affine transform to an image and then tiles the transformed image.
CIAffineTransform - Applies an affine transform to an image. You can scale, translate, or rotate the input image. You can also apply a combination of these operations.
CIAreaAverage - Calculates the average color for the specified area in an image, returning the result in a pixel.
CIAreaHistogram - Calculates a histogram for the specified area in an image, returning the result in a 1D image.
@wontondon
wontondon / AssetDatabaseOpenHelper.java
Created October 8, 2011 03:12
Copy sqlite database from assets dir - Android
package com.javatarts.basketballgm.data;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active June 13, 2024 02:39
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@patelrohan
patelrohan / gist:4352890
Last active August 21, 2018 20:05
Put UISearchBar in Navigation Controller
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Literature";
if (searchText.length > 0) {
[searchBar setShowsCancelButton:YES];
searchBar.text = searchText;
[self searchLiteraturesWithName:searchText];
}
[self.navigationController.navigationBar setTintColor:[UIColor primaryBarColor]];
@gimenete
gimenete / UIView+ActivityIndicator.h
Created July 11, 2013 09:01
Show an activity indicator in any UIView. Example: [imageView showActivityIndicator]; Then hide it [imageView hideActivityIndicator];
#import <Foundation/Foundation.h>
@interface UIView (ActivityIndicator)
- (void)showActivityIndicator;
- (void)showActivityIndicatorWithStyle:(UIActivityIndicatorViewStyle)style;
- (void)hideActivityIndicator;
@end
/* This Program set, start and stop hotspot in windows 7.*/
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int t=0;
void frame(void);
void main()
{
start0:
@natelandau
natelandau / .bash_profile
Last active June 13, 2024 18:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@iosdevzone
iosdevzone / CommonCryptoHack
Created September 21, 2014 03:14
A shell script to write a dummy CommonCrypto.framework module into the directory where playgrounds look for frameworks.
#!/bin/bash
if [[ $BASH_SOURCE != $0 ]]; then echo "$BASH_SOURCE must be executed, not sourced."; return 255; fi
#
# A script to fool iOS playgrounds into allowing access to CommonCrypto
#
# The script creates a dummy CommonCrypto.framework in the SDK's System
# Framework Library Directory with a module map that points to the
# umbrella header
#
# Usage:
@rgcottrell
rgcottrell / gist:5b876d9c5eea4c9e411c
Created September 21, 2014 17:38
An FM Synthesizer in Swift using AVAudioEngine
import AVFoundation
import Foundation
// The maximum number of audio buffers in flight. Setting to two allows one
// buffer to be played while the next is being written.
private let kInFlightAudioBuffers: Int = 2
// The number of audio samples per buffer. A lower value reduces latency for
// changes but requires more processing but increases the risk of being unable
// to fill the buffers in time. A setting of 1024 represents about 23ms of