Skip to content

Instantly share code, notes, and snippets.

View satyadeepk's full-sized avatar

Satyadeep satyadeepk

View GitHub Profile
@mlynch
mlynch / autofocus.js
Last active August 24, 2022 15:03
AngularJS Autofocus directive
/**
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded
* templates and such with AngularJS. Use this simple directive to
* tame this beast once and for all.
*
* Usage:
* <input type="text" autofocus>
*
* License: MIT
*/
@mrsasha
mrsasha / methodcount.bat
Created September 14, 2014 16:08
.jar and .dex method count helpers for Windows. dx from build-tools in the Android SDK has to be in your PATH. Just call methodcount.bat "filename"
@ECHO OFF
IF "%1"=="" GOTO MissingFileNameError
IF EXIST "%1" (GOTO ContinueProcessing) ELSE (GOTO FileDoesntExist)
:ContinueProcessing
set FileNameToProcess=%1
set FileNameForDx=%~n1.dex
IF "%~x1"==".dex" GOTO ProcessWithPowerShell
REM preprocess Jar with dx
@rogernolan
rogernolan / gist:95ea615164e343b3bc54
Last active November 6, 2015 19:57
Parse.com Cloudcode to Loggly logger
///
/// A very simple Loggly client for Parse.com cloudcode.
/// Usage:
/// logger = require('cloud/libs/logger');
/// logger.setToken('your-loggly-token', 'appname'); // Appname is optional.
///
/// logger.log("A String to Log", {'key': 'Extra fields to add to loggly entry'});
/// /// The logger will add a few fields replicating the iOS client fields to help filtering and setting up a grid view on Loggly.
///
/// logger.setConsoleLogging(false); // Stop the logger exhoing to Parse's console.
@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
@gfosco
gfosco / gist:131974d200c5e9fc6c94
Last active April 5, 2022 22:10
parse-jobqueue

README.md:

parse-jobqueue

The Parse Cloud Code job queue. Define, queue, and process work on a constant basis.

USAGE

First, you'll want to define some jobs:

@janakagamini
janakagamini / ParseProxyObject.java
Last active January 4, 2016 11:01 — forked from jamiechapman/ParseProxyObject.java
Since ParseObject is not Parcelable or Serializable this class makes a best effort to make a copy of a given ParseObject that is Serializable
// By Janaka Jayasuriya, @pinkydoe
// Original By Jamie Chapman, @chappers57
// License: open, do as you wish, just don't blame me if stuff breaks ;-)
package us.peripl.app.util;
import com.parse.ParseFile;
import com.parse.ParseGeoPoint;
import com.parse.ParseObject;
@satyadeepk
satyadeepk / log-parse.sh
Last active April 27, 2016 17:01
Drain Parse.com logs to a file
#!/bin/sh
# Restartes the parse log if it crashes
# stdbuf flushes the Parse log buffer so they come in real time
until stdbuf -oL /usr/local/bin/parse log -f > info.log; do
echo "Parse log crashed with exit code $?. Respawning.." >&2
sleep 1
done
@nicktoumpelis
nicktoumpelis / git-make-empty-root.sh
Last active May 9, 2025 08:50
Create an empty initial commit
git checkout --orphan temp_master
git rm -rf .
git commit --allow-empty -m 'Make initial root commit'
git rebase --onto temp_master --root master
git branch -D temp_master
@redox
redox / base.html.haml
Last active May 16, 2020 13:13
Algolia extends HipChat to customer support
#chat-box.ubuntu.hidden-xs
.closed
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()'
.m-l-small
= link_to_function 'Chat with us', 'chat.show()'
.opened{style: 'display: none'}
.header
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none'