Skip to content

Instantly share code, notes, and snippets.

View prashantghimire's full-sized avatar
💪
Getting stronger

Prashant Ghimire prashantghimire

💪
Getting stronger
View GitHub Profile
def starts_with_uppercase(word):
return word and 'A' <= word[0] <= 'Z'
def abbr_words(s: str):
words = s.split(' ')
print(words)
flag_map = [False] * len(words)
# loop until second last since are checking current and next item
for i in range(len(words) - 1):
import 'dart:async';
import 'dart:convert';
import 'dart:io';
var STORE = new List<Profile>();
var DB = new List<Profile>();
Future<void> main() async {
var things = await getThings();
STORE.addAll(things);
@prashantghimire
prashantghimire / evenodd.js
Last active October 4, 2017 01:50
JS for determining even/odd number
//taking the input array
var myNumbers = [14, 13, 11, 71, 7, 34, 48, 5, 44, 99, 23, 4, 29, 27, 62];
//starting number separator with the parameter
function numSeparator(numbers) {
//declaring two arrays
var evenNums = [];
var oddNums = [];
@prashantghimire
prashantghimire / center.css
Created May 10, 2016 05:16
CSS center item
.blueBox {
margin: 0 auto;
}
.container {
position: absolute;
top: 50%;
margin-top: -50px;
left: 0;
width: 100%;
}
// Code goes here
var asyncMethod = function (message){
return new Promise(function (fulfill, reject){
setTimeout(function (){
console.log(message);
fulfill();
}, 1000);
});
};
@prashantghimire
prashantghimire / this.js
Created May 6, 2016 23:56
ThisJavaScript
'use strict';
var obj = {
val : 'Hi there',
printVal: function (){
console.log(this);
}
};
var obj2 = {
val : 'What up?'
};
@prashantghimire
prashantghimire / iife.js
Created May 6, 2016 23:38
JavaScript IIFE
'use strict';
var obj = {
a: {
b: {
c: 'Hello World'
}
}
};
Toast.makeText(getApplicationContext(), names.get(position),Toast.LENGTH_LONG).show();
@prashantghimire
prashantghimire / MainActivity.java
Created May 2, 2016 06:42
Sample List View Android
package ghimire.com.listview;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
@prashantghimire
prashantghimire / RandomVoice.java
Last active May 2, 2016 06:33
Random voice generator with Banana always being first
/**
* @author Prashant Ghimire
*/
import java.util.Random;
public class RandomVoice {
public static void main(String[] args) {
System.out.println(randomVoice());
}