Skip to content

Instantly share code, notes, and snippets.

@kumaraish
kumaraish / C++: C++.sublime-build
Last active August 29, 2015 14:02
C++: Integrate MinGW into Sublime Text 2 on Windows
{
"cmd": ["g++", "-std=c++11", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
@kumaraish
kumaraish / sublime
Last active August 29, 2015 14:03
Sublime Text 3.0 Tips
How to crack Sublime Text (2 and 3)
===
1. Open Sublime in a HEX editor (the executable file)
2. Find 43 33 33 42 30 32
3. Replace in the string above 33 42 with 32 42
4. Save
5. Enter the license below:
—–BEGIN LICENSE—–
@kumaraish
kumaraish / copy_move_ctor_assign_dtor.cpp
Created June 26, 2014 20:46
Construction, Move, Copy, Destruction
/* The comments about copy/move operations optimized away (elided) by the compiler are
from compilation using
g++ (tdm64-2) 4.8.1
on a Windows 7 64-bit machine
The behaviour on other systems would be interesting to see.
*/
#include <iostream>
class Integer {
public:
@kumaraish
kumaraish / README
Last active August 29, 2015 14:07 — forked from MarsVard/README
Android Background Card
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
<View
android:layout_width="fill_parent"
@kumaraish
kumaraish / Material Design Colors
Last active August 29, 2015 14:15 — forked from cypressious/Material Design Colors
Material Design Colors
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@kumaraish
kumaraish / Factories.java
Last active August 29, 2015 14:17
Design Pattern - Factories
/** Static Factory Method
*
* "Static factory method is simply a static method that returns an instance of a class."
* (c) Effective Java, Joshua Bloch
*
*/
// Use - Descriptive names for Constructors
public class Coordinate {
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
@kumaraish
kumaraish / history.xml
Created June 25, 2016 15:19
Android icon created using xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#616123"
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z" />
</vector>
@kumaraish
kumaraish / jekyll.txt
Last active December 31, 2020 10:30
Installing Jekyll on Windows
References:
1. http://jekyllrb.com/docs/home/
2. https://labs.sverrirs.com/jekyll/
3. https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/
4. http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages
Jekyll v3.x requires Ruby version >= 2.0.0.
Ruby installation
-installation via chocolatey