Skip to content

Instantly share code, notes, and snippets.

View gdgupta11's full-sized avatar

Gaurav Gupta gdgupta11

View GitHub Profile
@gdgupta11
gdgupta11 / golang_cheatsheet.md
Last active July 8, 2020 05:35
Golang cheatsheet for beginners

Golang cheatsheet

This cheatsheet was created by one of my colleague Austin. Just sharing it here because I found it useful

Install Go on your MAC

Follow these steps to install go onto your mac and test out the installation

Python Small learning functions and examples

Reading and Writing JSON Objects and Files

Reading from python objects

"""
	When you want to read from python string object and conver to python Dict:
		json.loads(pythonString) --> result is python dict 

Keybase proof

I hereby claim:

  • I am gdgupta11 on github.
  • I am gdgupta11 (https://keybase.io/gdgupta11) on keybase.
  • I have a public key whose fingerprint is D841 FCAD 4741 5299 499B 59D2 29D3 5B93 C396 079D

To claim this, I am signing this object:

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
myApp: "Testing"
});
@gdgupta11
gdgupta11 / components.cart-contents.js
Last active December 12, 2018 02:24
ember_services_1
import Ember from 'ember';
var inject = Ember.inject;
export default Ember.Component.extend({
//will load the service in file /app/services/shopping-cart.js
start: inject.service('start'),
checkValue: Ember.computed('record',function(){
status = false
var name = this.get('record.name')
var value1 = this.get('record.value')
import Ember from 'ember';
import EmberObject from '@ember/object';
export default Ember.Component.extend({
fname:"Gaurav",
lname:"Gupta",
fullName: Ember.computed('fname','lname', function(){
return `${this.fname} ${this.lname}`;
}),
todos: null,
@gdgupta11
gdgupta11 / components.posts-list.js
Last active December 12, 2018 02:27
component_attribute_binding
import Ember from 'ember';
export default Ember.Component.extend({
location: "Bangalore"
});
@gdgupta11
gdgupta11 / components.list-items.js
Last active April 4, 2018 13:41
basic_component_positional_parms
import Ember from 'ember';
export default Ember.Component.extend({
name: Ember.computed('params.[]', function(){
return this.get('params')[0];
}),
id:Ember.computed('params.[]', function(){
return this.get('params')[2];
}),
location:Ember.computed('params.[]', function(){
@gdgupta11
gdgupta11 / controllers.application.js
Last active December 12, 2018 02:54
Basics_action_bubbling
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
hasHat: true,
hatColor: "blue",
colors: ["blue", "red","green", "yellow", "black", "purple", "orange"],
actions: {
putOnHat(color){
this.set('hatColor', color);
@gdgupta11
gdgupta11 / controllers.application.js
Created April 4, 2018 09:30
Ember_actions_basics
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
hasHat: true,
hatColor: "blue",
colors: ["blue", "red","green", "yellow", "black", "purple", "orange"],
actions: {
putOnHat(color){
this.set('hatColor', color);