Skip to content

Instantly share code, notes, and snippets.

@tarunmahe
tarunmahe / Git push deployment in 7 easy steps.md
Created April 20, 2018 18:08 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@tarunmahe
tarunmahe / Contact.java
Created August 31, 2017 14:44 — forked from bugraoral/Contact.java
Loading contacts with thumbnail images faster. Normally, with any loader fetching 500 contacts with images can take up to 3 seconds. With this task you can load them in ~500ms.
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.IntDef;
import android.text.TextUtils;
import java.io.Serializable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
public class Contact {
@tarunmahe
tarunmahe / file0.swift
Created May 9, 2017 10:15 — forked from 1amageek/file0.swift
Firebase Cloud Functionsを使ってFacebook AccountKitをFirebase Authと連携する ref: http://qiita.com/1amageek/items/c7adbd9f2bbf3a57d352
// AccoutKitの初期化
let accountKit: AKFAccountKit = AKFAccountKit(responseType: .authorizationCode)
// AccountKitを起動して電話番号認証を行う
func login() {
let inputStatus: String = UUID().uuidString
let viewController: AKFViewController = self.accountKit.viewControllerForPhoneLogin(with: nil, state: inputStatus) as! AKFViewController
prepareLoginViewController(viewController: viewController)
self.present(viewController as! UIViewController, animated: true, completion: nil)
@tarunmahe
tarunmahe / wordpress-firebase.php
Created April 29, 2017 09:53 — forked from derekconjar/wordpress-firebase.php
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
@tarunmahe
tarunmahe / fix-wordpress-permissions.sh
Created February 28, 2017 11:52 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@tarunmahe
tarunmahe / DeviceUID.m
Created August 13, 2016 19:17 — forked from miguelcma/DeviceUID.m
iOS Unique Device ID that persists between app reinstalls
/* DeviceUID.h
#import <Foundation/Foundation.h>
@interface DeviceUID : NSObject
+ (NSString *)uid;
@end
*/
// Device.m
@tarunmahe
tarunmahe / apitest.php
Created July 24, 2016 12:10 — forked from karlkranich/apitest.php
Updated PHP code to use the Google Sheets API. See usage instructions at http://karl.kranich.org/2015/04/16/google-sheets-api-php/ More examples at https://gist.github.com/karlkranich/afa39e3d778455b38c38
<?php
// apitest.php
// by Karl Kranich - karl.kranich.org
// version 3.1 - edited query section
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php');
include_once "google-api-php-client/examples/templates/base.php";
$client = new Google_Client();
@tarunmahe
tarunmahe / main.js
Last active August 29, 2015 14:27 — forked from gfosco/main.js
// The before save handler will pass information to the after save handler to disable the
// after save handler from creating a loop.
// It also prevents client side code from triggering the silent change, by using a different flag
// that the client should never see.
// It should only be visible in the data browser, won't be sent to a client in an undefined state.
Parse.Cloud.beforeSave('TestObject', function(request, response) {
handleComingFromTask(request.object);
response.success();
});