Skip to content

Instantly share code, notes, and snippets.

View rajajawahar's full-sized avatar
🏠
Working from home

Raja Jawahar rajajawahar

🏠
Working from home
View GitHub Profile
@rajajawahar
rajajawahar / UninstallTensorFlow.txt
Created November 16, 2018 05:24 — forked from supriya-gdptl/UninstallTensorFlow.txt
Steps to uninstall tensorflow
pip show tensorflow
pip uninstall tensorflow
# Tensorflow 1.4 works only with Python 3.5
# to install downgrade Python 3.6 to Python 3.5 in Anaconda
conda install python=3.5
# now install tensorflow 1.4
sudo apt-get install python3-pip python3-dev
pip install tensorflow
@rajajawahar
rajajawahar / dark.md
Created July 10, 2018 14:48 — forked from a7madgamal/dark.md
Dark mode for Slack on MacOS
  1. Close slack
  2. Open this file /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
  3. Append this to it
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
   success: function(css) {
 $("").appendTo('head').html(css);
@rajajawahar
rajajawahar / ShareUtils.java
Created July 7, 2018 16:12 — forked from Mariovc/ShareUtils.java
Utility to share text and url on Facebook, Twitter and Whatsapp
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
@rajajawahar
rajajawahar / main.go
Created May 4, 2018 06:14 — forked from mschoebel/main.go
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
package main
import (
"database/sql"
"gopkg.in/gorp.v1"
"log"
"strconv"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
@rajajawahar
rajajawahar / ChangePassword.java
Created February 1, 2018 12:55 — forked from zach-klippenstein/ChangePassword.java
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall (rsdio@metastatic.org), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{
//http://stackoverflow.com/questions/2422383/uinavigationbar-multi-line-title
private func setupTitleView() {
let topText = NSLocalizedString("key", comment: "")
let bottomText = NSLocalizedString("key", comment: "")
let titleParameters = [NSForegroundColorAttributeName : UIColor.<Color>(),
NSFontAttributeName : UIFont.<Font>]
let subtitleParameters = [NSForegroundColorAttributeName : UIColor.<Color>(),
NSFontAttributeName : UIFont.<Font>]
@rajajawahar
rajajawahar / ApiModule.java
Created October 23, 2017 09:03 — forked from koesie10/ApiModule.java
Retrofit 1 error handling behaviour in Retrofit 2
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
public class MainActivity extends AppCompatActivity {
public static class Shop {
public int id;
public String name;
public List<Coordinate> coordinates = new ArrayList<>();
@Override
public String toString() {
String str = id + " (" + name + ") [ ";
/*
* Copyright (C) 2013 Tomáš Procházka
*
* 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