Skip to content

Instantly share code, notes, and snippets.

View verygreenboi's full-sized avatar
💻
Slamming keys!

Thompson Edolo verygreenboi

💻
Slamming keys!
View GitHub Profile
@verygreenboi
verygreenboi / isPalindrome.js
Created January 5, 2020 13:29 — forked from jherax/isPalindrome.js
Determines whether a string is a palindrome
/**
* Determines whether a text is a palindrome.
* Text is lowercased and non-alphabetic characters are removed.
*
* @param {string} text - the words to check
* @return {boolean}
*/
function isPalindrome(text) {
if (!text || text.length < 2) return false;
text = text.replace(/[\s\W]/g, '');
@verygreenboi
verygreenboi / README.md
Created January 5, 2020 13:27 — forked from jherax/README.md
Git Alias and Rebase

Git Alias and Git Rebase

WHEN TO DO REBASE

After each commit in our branch, in order to be up-to-date with the integration branch.

@verygreenboi
verygreenboi / filterArray.js
Created January 5, 2020 13:24 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects by custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
apiVersion: v1
kind: Namespace
metadata:
name: mongo
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mongo
namespace: mongo
@verygreenboi
verygreenboi / ci_pipeline_travis_example.yml
Created December 14, 2018 02:07 — forked from JacopoDaeli/ci_pipeline_travis_example.yml
TravisCI setup example for CI pipeline
# Use Dockerized infrastructure
sudo: false
# Use node_js environnement
language: node_js
node_js:
- "6"
# Cache Gcloud SDK between commands
cache:
import Foundation
import UIKit
// Usage Examples
let system12 = Font(.system, size: .standard(.h5)).instance
let robotoThin20 = Font(.installed(.RobotoThin), size: .standard(.h1)).instance
let robotoBlack14 = Font(.installed(.RobotoBlack), size: .standard(.h4)).instance
let helveticaLight13 = Font(.custom("Helvetica-Light"), size: .custom(13.0)).instance
struct Font {
public static boolean isNetworkAvailable (Context context) {
if (connectedToTheNetwork(context)) {
try {
HttpURLConnection urlc = (HttpURLConnection)
(new URL("http://clients3.google.com/generate_204")
.openConnection());
urlc.setRequestProperty("User-Agent", "Android");
urlc.setRequestProperty("Connection", "close");
urlc.setConnectTimeout(1500);
urlc.connect();
@verygreenboi
verygreenboi / android_color_transparency.txt
Created June 6, 2018 13:23 — forked from cesarferreira/android_color_transparency.txt
android color transparency cheat sheet
<color name="black">#**000000</color>
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
@verygreenboi
verygreenboi / CloudCode.js
Created October 3, 2017 16:46 — forked from gimdongwoo/CloudCode.js
Background Job in Parse Server (node/cron)
// src/CloudCode.js
"use strict"
var Cron = require('./Cron');
var Job = require('./Job');
class CloudCode {
constructor(Parse, timezone){
this.Parse = Parse;
@verygreenboi
verygreenboi / CountingFileRequestBody.java
Last active August 29, 2015 14:27 — forked from eduardb/CountingFileRequestBody.java
Uploading a file with a progress displayed using OkHttp
public class CountingFileRequestBody extends RequestBody {
private static final int SEGMENT_SIZE = 2048; // okio.Segment.SIZE
private final File file;
private final ProgressListener listener;
private final String contentType;
public CountingFileRequestBody(File file, String contentType, ProgressListener listener) {
this.file = file;