Skip to content

Instantly share code, notes, and snippets.

@jaydp17
jaydp17 / keybase.md
Last active November 23, 2019 11:27

Keybase proof

I hereby claim:

  • I am jaydp17 on github.
  • I am jaydp17 (https://keybase.io/jaydp17) on keybase.
  • I have a public key ASBKlOwLUwjtzzkbgFPATsDdC-rt1IaiXsdi612ryZFnhQo

To claim this, I am signing this object:

@jaydp17
jaydp17 / build.gradle
Created October 30, 2015 03:31
Kotlin and dataBinding
apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.mvptestkotlin"
@jaydp17
jaydp17 / diskSpace.sh
Last active August 29, 2015 14:15
A command to see which folder/files are eating up the disk space
sudo du -d 5 -h -x / | grep '^\s*[0-9\.]\+G'
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="512dp"
android:layout_height="512dp"
public class DummyActivity extends ActionBarActivity {
File f;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dummylayout);
@jaydp17
jaydp17 / barebone_mors.js
Created December 31, 2014 08:19
A simple server using mors
var mors = require('mors'),
mosca = require('mosca'),
app = mors();
app.all('*', function (req, res, next) {
res.topic(req.topic).publish(req.payload);
});
var ascoltatore = {
//using ascoltatore
@jaydp17
jaydp17 / barebone_mosca.js
Last active December 10, 2015 15:09
A simple server using mosca
var mosca = require('mosca')
var ascoltatore = {
//using ascoltatore
type: 'mongo',
url: 'mongodb://localhost:27017/mqtt',
pubsubCollection: 'ascoltatori',
mongo: {}
};

Openshift

To manage openshift apps we'll be using rhc.

Setup rhc

Follow the first 3 steps from here

Creating a rails app

require.config({
baseUrl : "bower_components/codemirror",
});
require(['lib/codemirror', 'addon/hint/show-hint'], function(CodeMirror, sh) {
console.log(CodeMirror.defaults);
console.log(CodeMirror.showHint);
});
@jaydp17
jaydp17 / 0_reuse_code.js
Created January 26, 2014 04:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console