Skip to content

Instantly share code, notes, and snippets.

View nisrulz's full-sized avatar
🌌
Coding in the MultiVerse

Nishant Srivastava nisrulz

🌌
Coding in the MultiVerse
View GitHub Profile
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@nisrulz
nisrulz / convert-png-to-webp
Last active August 29, 2015 14:27 — forked from jonjensen/convert-png-to-webp
Batch convert PNG files to WebP in 1 directory
#!/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
# cd to the directory of the image so we can work with just filenames
dir="$(dirname "$1")"
cd "$dir" || exit 1
base="$(basename "$1" .png)"
# create a WebP version of the PNG
@nisrulz
nisrulz / build.gradle
Created October 30, 2015 19:54 — forked from ph0b/build.gradle
sample build.gradle for generating split APKs per ABI
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig{
minSdkVersion 14
targetSdkVersion 21
versionCode 101
@nisrulz
nisrulz / AndroidManifest.xml
Created February 15, 2016 06:36 — forked from billmote/AndroidManifest.xml
When pushing code from your IDE, wake the device and show the activity.
<?xml version="1.0" encoding="utf-8"?>
<!-- Add this as a debug manifest so the permissions won't be required by your production app -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
</manifest>
@nisrulz
nisrulz / update.sh
Created April 21, 2016 18:28 — forked from kaushikgopal/update.sh
My morning cli ritual
echo "y" | android update sdk --no-ui; echo "yes" | apm upgrade; softwareupdate -i -a; brew update; brew upgrade; brew cleanup; brew cask cleanup; npm update npm -g; npm update -g; gem update
@nisrulz
nisrulz / README.md
Created July 4, 2016 17:08 — forked from JakeWharton/README.md
A JUnit @rule which launches an activity when your test starts. Stop extending gross ActivityInstrumentationBarfCase2!
@nisrulz
nisrulz / filter.regexp
Created July 10, 2016 10:16 — forked from stepango/filter.regexp
Filter for logcat
^(?!(NotificationManager|Timeline|SensorManager|Configs|libc-netbsd|art|stetho|Choreographer|CliptrayUtils|BubblePopupHelper|ViewRootImpl|libEGL|System.out|PhoneWindow))
@nisrulz
nisrulz / config
Created July 13, 2016 06:18 — forked from donnfelker/config
Watch or Unwatch a file in git
# Goes in your .git/config file
[alias]
# Temporarily stop tracking a file in git.
# usage: git unwatch path/to/file
unwatch = update-index --assume-unchanged
# Resume tracking a file in git.
# usage: git watch path/to/file
watch = update-index --no-assume-unchanged
@nisrulz
nisrulz / .gitconfig
Created July 13, 2016 06:18 — forked from donnfelker/.gitconfig
My .gitconfig
[user]
name = Your Name
email = you@youremail.com
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD