Skip to content

Instantly share code, notes, and snippets.

View arkka's full-sized avatar

Arkka Dhiratara arkka

View GitHub Profile
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@cheekybastard
cheekybastard / scrapy_plus_selenium_renderedpage
Created February 13, 2013 14:17
Using Scrapy with Selenium to scape a rendered page
#Using Scrapy with Selenium to scape a rendered page [Updated]
from scrapy.contrib.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from selenium import selenium
@asafge
asafge / ng-really.js
Created November 12, 2013 13:06
ng-really? An AngularJS directive that creates a confirmation dialog for an action.
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
@diorahman
diorahman / index.html
Created June 25, 2014 01:34
Peta Rupa Bumi. Menampilkan peta dasar dari layanan SatuPeta Badan Informasi Geospasial Indonesia. Kami berharap mereka akan segara lompat ke "stack" kode sumber terbuka. Informasi sumber data: http://data.ukp.go.id/dataset/rupa-bumi-indonesia dan rilis dengan Web Mercator Auxiliary Sphere tiling scheme (WKID 102100/3857) dan memakai default sca…
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%; width: 100%; margin: 0; padding: 0;
@hkhamm
hkhamm / installing_cassandra.md
Last active May 5, 2024 13:14
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@robcowie
robcowie / spark_notes.md
Last active April 11, 2022 22:30
Apache Spark Notes

Install Apache Spark (OSX)

$ brew install apache-spark

Run the Spark python shell

A python shell with a preconfigured SparkContext (available as sc). It is

@vincent99
vincent99 / gist:491afed2306ba448dd89
Last active August 14, 2019 01:16
Simple example of subscribing to Rancher change events
/*
Setup:
npm install ws
Usage:
Create an API key in Rancher and start up with:
node socket.js address.of.rancher:8080 access_key secret_key project_id
*/
var WebSocket = require('ws');
@ololobus
ololobus / Spark+ipython_on_MacOS.md
Last active November 22, 2022 22:24
Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112

For older versions of Spark and ipython, please, see also previous version of text.

Install Java Development Kit

@garycrawford
garycrawford / docker-compose.yml
Created July 9, 2015 13:00
MongoDB Replica Set docker-compose.yml
primary:
image: mongo:3.0
volumes:
- ./p:/data
ports:
- "27017:27017"
# Our current version of docker-compose doesn't allow extra_hosts which would be the best way
# to add curcular dependency container links in this case. We cant upgrade docker-compose
# without upgrading docker to 1.7, and we can't do that without upgrading the kernel on our
# CentOS VM's. As such we are using the hostname hask below to allow primary and secondary
@bonzanini
bonzanini / run_luigi.py
Created October 24, 2015 14:56
Example of Luigi task pipeline
# run with a custom --n
# python run_luigi.py SquaredNumbers --local-scheduler --n 20
import luigi
class PrintNumbers(luigi.Task):
n = luigi.IntParameter(default=10)
def requires(self):
return []