This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="io.github.cyb3rn4u7.imagepicker"> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Example { | |
private ss: string; | |
constructor(s:string){ | |
this.ss = s; | |
} | |
// Functional Cohesion | |
parseString(s: string): string { | |
this.ss = s + "..."; | |
return this.ss; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search() { | |
console.log('this.state', this.state); | |
const BASE_URL = 'https://api.spotify.com/v1/search?'; | |
const FETCH_URL = `${BASE_URL}q=${this.state.query}&type=artist&limit=1`; | |
// get your access token : https://developer.spotify.com/console/get-search-item/ | |
// click get token button , copy paste the token below and you are good to go | |
var accessToken = 'YOUR_TOKEN'; | |
var myOptions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
// serve up production assets | |
app.use(express.static('client/build')); | |
// serve up the index.html if express does'nt recognize the route | |
const path = require('path'); | |
app.get('*', (req, res) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate fibnacci numbers using generators | |
* A simple illustration of the power that generators | |
* can bring in our code | |
* | |
* generator is from the https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators | |
*/ | |
function* fibonacci() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
import { HistoryComponent } from './history.component'; | |
fdescribe('HistoryComponent', () => { | |
let component: HistoryComponent; | |
let fixture: ComponentFixture<HistoryComponent>; | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let table = document.querySelector("tbody"); | |
const _self = this; | |
// this way we avoid data binding | |
_self.dragNdrop = JSON.parse(JSON.stringify(_self.formItems)); | |
Sortable.create(table, { | |
onEnd({ | |
newIndex, | |
oldIndex | |
}) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example usage | |
const chars = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z".split(' '); | |
const limit = 2; | |
console.log(generator(limit, chars)); | |
/** | |
* Unique letter combination permutations generator that only generates unique strings like | |
* 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', |