Skip to content

Instantly share code, notes, and snippets.

View MaxySpark's full-sized avatar
🐧
JS in Front JS in Back

BHARGAB MaxySpark

🐧
JS in Front JS in Back
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@prettymuchbryce
prettymuchbryce / Dictionary.java
Created September 14, 2012 02:26
Dictionary with trie tree Java
//Dictionary implemented using a Trie Tree.
public class Dictionary {
private HashMap<Character,Node> roots = new HashMap<Character,Node>();
/**
* Search through the dictionary for a word.
* @param string The word to search for.
* @return Whether or not the word exists in the dictionary.
*/
public boolean search(String string) {
@wbroek
wbroek / genymotionwithplay.txt
Last active November 8, 2024 01:24
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@bonzanini
bonzanini / sentiment_classification.py
Last active October 30, 2020 23:58
Sentiment analysis with scikit-learn
# You need to install scikit-learn:
# sudo pip install scikit-learn
#
# Dataset: Polarity dataset v2.0
# http://www.cs.cornell.edu/people/pabo/movie-review-data/
#
# Full discussion:
# https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn
@pbnj
pbnj / index.js
Last active September 13, 2018 20:41
Demo Command-Line Interface (CLI) Application
#!/usr/bin/env node
'use strict';
/**
* Require dependencies
*
*/
const program = require('commander'),
chalk = require("chalk"),
exec = require('child_process').exec,
pkg = require('./package.json');
@Savjee
Savjee / gist:b4b3a21d143a30e7dc07
Created January 16, 2016 18:49
s3-webhosting-bucket-policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
# HTTP — redirect all traffic to HTTPS
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
return 301 https://$host$request_uri;
}
# HTTPS — proxy all requests to the Node app
server {
# Enable HTTP/2
@acutmore
acutmore / onSettled.js
Created February 17, 2022 17:40
utility function to take an array of promises and return an async iterator that yield results as promises settle
/** @param promises {Array<Promise<unknown>>} */
export async function * onSettled(promises) {
let wake;
let wait = new Promise(_ => wake = _);
let pending = promises.length;
const queue = [];
for (const p of promises) {
Promise.allSettled([p]).then(([result]) => {
queue.push(result);
@dfkaye
dfkaye / async-promise-iterator.js
Last active March 23, 2022 18:18
async iterator function that yields resolved promises from an array but in *resolution* order.
// 17 Feb 2022
// Not mine!!
// It just kicks ass in every way possible!
// Slightly modified and commented version of that by @reu (Rodrigo Navarro)
// https://gist.github.com/reu/d49c9e45138ed6909db5418f20236376
// 20 Feb 2022:
// Change queue semantics (shift, not pop, for FIFO ordering).