Skip to content

Instantly share code, notes, and snippets.

View Nihhaar's full-sized avatar
🎯
Focusing

Nihhaar_RC Nihhaar

🎯
Focusing
View GitHub Profile
@Nihhaar
Nihhaar / repo-apply.sh
Created July 8, 2017 07:50 — forked from gipi/repo-apply.sh
Split a patch created with repo diff in a set of usable patches
#!/bin/sh
## Script to patch up diff reated by `repo diff`
# from https://groups.google.com/d/msg/repo-discuss/43juvD1qGIQ/7maptZVcEjsJ
if [ -z "$1" ] || [ ! -e "$1" ]; then
echo "Usages: $0 <repo_diff_file>";
exit 0;
fi
rm -fr _tmp_splits*
@Nihhaar
Nihhaar / postgres_queries_and_commands.sql
Created July 18, 2017 09:45 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@Nihhaar
Nihhaar / stdc++.h
Created July 27, 2017 23:12 — forked from velicast/stdc++.h
Linux GCC 4.8.0 /bits/stdc++.h header definition.
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@Nihhaar
Nihhaar / .bash_profile
Created August 5, 2017 16:42 — forked from natelandau/.bash_profile
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
@Nihhaar
Nihhaar / ML DataSets - Recommendations
Last active August 22, 2017 20:50 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning
**Movies Recommendation**:
* *MovieLens* - Movie Recommendation Data Sets http://www.grouplens.org/node/73
* *Yahoo!* - Movie, Music, and Images Ratings Data Sets http://webscope.sandbox.yahoo.com/catalog.php?datatype=r
* *Jester* - Movie Ratings Data Sets (Collaborative Filtering Dataset) http://www.ieor.berkeley.edu/~goldberg/jester-data/
* *Cornell University* - Movie-review data for use in sentiment-analysis experiments http://www.cs.cornell.edu/people/pabo/movie-review-data/
**Music Recommendation**:
* *Last.fm* - Music Recommendation Data Sets http://www.dtic.upf.edu/~ocelma/MusicRecommendationDataset/index.html
@Nihhaar
Nihhaar / linux_performance.md
Created September 18, 2017 18:42 — forked from marianposaceanu/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@Nihhaar
Nihhaar / Android Memory Management Notes.md
Created September 22, 2017 23:49 — forked from blixtra/Android Memory Management Notes.md
Notes taken while looking into memory issues on low-RAM devices

Android Memory Management

Android has a unique memory management model. Below, are the notes taken while we try to understand it thoroughly.

Activity Manager

Overview

The ActivityManager, among other things, is responsible for making sure that apps that are most important to the user and/or essential remain active. It does this by dynamically assigning values that roughly indicate the app's importance. When memory gets low these values are used to find the apps that need to be "trimmed." The memory from these "trimmed" apps is freed, making more available for the more important apps.

@Nihhaar
Nihhaar / PersistentCookieStore.java
Created October 7, 2017 13:28 — forked from lezorich/PersistentCookieStore.java
Android basic persistent cookie manager for Volley. This cookie store wraps the default CookieManager store to store the session cookie. It use's Gson to json serialize the cookie and store it as a json string in SharedPreferences.
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Lukas Zorich
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
/*icon nav*/
/* 1 */
html.MTCenabled #fbRequestsJewel a.jewelButton, html.MTCenabled #fbRequestsJewel a.jewelButton:hover, html.MTCenabled #fbRequestsJewel a.jewelButton:focus{
background-image: url(https://ssl10.ovh.net/~ecclesia/myFacebook/img/sprite.png) !important;
background-position: -56px -134px !important;
}
html.MTCenabled #fbRequestsJewel a.jewelButton:active{
background-image: url(https://ssl10.ovh.net/~ecclesia/myFacebook/img/sprite.png) !important;
background-position: -25px -134px !important;
}
@Nihhaar
Nihhaar / README.md
Created December 22, 2017 09:34 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha: