Skip to content

Instantly share code, notes, and snippets.

View flarco's full-sized avatar
Targeting

Fritz Larco flarco

Targeting
View GitHub Profile
import os
data = {
'1MB' : 1*1024*1024, # 1MB
'10MB' : 10*1024*1024, # 10MB
'100MB' : 100*1024*1024, # 100MB
'1GB' : 1*1024*1024*1024, # 1GB
'10GB' : 10*1024*1024*1024, # 10GB
'50GB' : 50*1024*1024*1024, # 50GB
}
@samklr
samklr / Job.scala
Created June 27, 2017 19:19
Spark Streaming Websocket Receiver
val ssc = new StreamingContext("local", "datastream", Seconds(15))
// create InputDStream
ssc.registerInputStream(stream)
// interact with stream
ssc.start()
@motatoes
motatoes / stopwatch.vue
Last active April 30, 2021 13:05
quick and dirty stopwatch component for vueJS
<template>
<span id="time" v-html="time"></span>
</template>
<style>
</style>
<script>
module.exports = {
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 19, 2024 23:55
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@eellpp
eellpp / gist:fcdcb03ca02fbd495b67ce7e488422f5
Last active August 17, 2018 12:02
Running Hadoop in pseudo-distributed mode on mac
> brew install hadoop
This installs hadoop at /usr/local/Cellar/hadoop/2.7.3
Find java home
> cd /usr/local/Cellar/hadoop/2.7.3
> vim etc/hadoop/hadoop-env.sh
The JAVA_HOME should be set as below in file
export JAVA_HOME="$(/usr/libexec/java_home)"
@cmatskas
cmatskas / GitDeleteCommands.ps1
Last active September 22, 2022 07:59
Git Delete Branch commands
## Delete a remote branch
$ git push origin --delete <branch> # Git version 1.7.0 or newer
$ git push origin :<branch> # Git versions older than 1.7.0
## Delete a local branch
$ git branch --delete <branch>
$ git branch -d <branch> # Shorter version
$ git branch -D <branch> # Force delete un-merged branches
## Delete a local remote-tracking branch
@dapangmao
dapangmao / s.bash
Last active September 1, 2020 16:28
How to set up a spark cluster on digitalocean
sudo openvpn --config *.opvn
apt-get update
apt-get install vim
wget http://d3kbcqa49mib13.cloudfront.net/spark-1.3.0-bin-hadoop2.4.tgz | tar zxf
hadoop fs -mkdir /spark
hadoop fs -put spark-1.3.0-bin-hadoop2.4.tgz /spark
hadoop fs -du -h /spark
cp spark-env.sh.template spark-env.sh
@barrysteyn
barrysteyn / svn-to-git.md
Last active December 26, 2022 22:32
Migrate From SVN To GIT
@victorquinn
victorquinn / promise_while_loop.js
Last active March 30, 2023 04:29
Promise "loop" using the Bluebird library
var Promise = require('bluebird');
var promiseWhile = function(condition, action) {
var resolver = Promise.defer();
var loop = function() {
if (!condition()) return resolver.resolve();
return Promise.cast(action())
.then(loop)
.catch(resolver.reject);
@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);