Skip to content

Instantly share code, notes, and snippets.

View ashgreat's full-sized avatar
💭
Writing a book

Ashwin Malshe ashgreat

💭
Writing a book
View GitHub Profile
library(sf)
library(spatstat)
library(sp)
library(maptools)
library(raster)
library(cartography)
library(SpatialPosition)
## import dataset
feat <- sf::st_read("https://gist.githubusercontent.com/rCarto/747164575e3f216a123c3092d0ce9162/raw/f12390464f255b5f9760c577ab6bf5456cf61a40/iris75.geojson")
@dpseidel
dpseidel / default_aes.md
Last active February 12, 2021 17:08
Default ggplot2 aesthetics table

Default ggplot2 aesthetics by geom.

geom alpha angle colour family fill fontface height hjust lineheight linetype shape size stroke vjust weight width xmax xmin ymax ymin
GeomAbline NA black 1 0.5
GeomAnnotationMap NA NA grey20 1 0.5
GeomArea NA NA grey20 1 0.5
GeomBar NA NA grey35 1 0.
rate_delay_seconds = 0
error_delay_seconds = 5
threads = 5
select_tweets_since = datetime.datetime.strptime("2017-04-01", '%Y-%m-%d')
select_tweets_until = datetime.datetime.strptime("2017-04-30", '%Y-%m-%d')
twitSlice = TwitterSlicer(rate_delay_seconds, error_delay_seconds, select_tweets_since, select_tweets_until,
threads)
@primaryobjects
primaryobjects / nnet.R
Created March 28, 2016 19:53
Neural network (nnet) with caret and R. Machine learning classification example, includes parallel processing.
library(caret)
library(doParallel)
registerDoParallel(cores = 2)
# Read data.
data <- read.csv('train.csv')
test <- read.csv('test.csv')
# Set classification column to factor.
@lopspower
lopspower / README.md
Last active May 15, 2025 02:53
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@jalapic
jalapic / viridisschiz
Created October 3, 2015 01:27
Australian Schizophrenia Births
### Example Viridis Plot
library(ggplot2)
library(viridis)
library(season)
library(gridExtra)
pa<-ggplot(schz, aes(year, month, fill = SczBroad)) +
geom_tile(colour="gray20", size=1.5, stat="identity") +
scale_fill_viridis(option="A") +
@johnmurch
johnmurch / results.csv
Last active May 6, 2022 23:47
Scraper for Seeking Alpha
Author URL Count Keywords
Prudent Finances http://seekingalpha.com//author/prudent-finances 1 ex
Dividend Dreams http://seekingalpha.com//author/dividend-dreams 1 ex
Ranjit Goswami http://seekingalpha.com//author/ranjit-goswami 1 ex
WisdomTree http://seekingalpha.com//author/wisdomtree 3 hedge fund,former,ex
George Fisher http://seekingalpha.com//author/george-fisher 1 ex
Edward Harrison http://seekingalpha.com//author/edward-harrison 1 ex
Chris Lau http://seekingalpha.com//author/chris-lau 1 ex
Matthew Bradbard http://seekingalpha.com//author/matthew-bradbard 1 ex
Andy Singh http://seekingalpha.com//author/andy-singh 1 ex
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active March 2, 2025 04:15
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts

@jennybc
jennybc / yaml_frontmatter_r_github_document.yaml
Last active February 9, 2022 21:36
YAML frontmatter for R Markdown to cause rmarkdown::render() to retain intermediate Markdown file for .R and .Rmd files, respectively
#' ---
#' title: "Something fascinating"
#' author: "Jenny Bryan"
#' date: "`r format(Sys.Date())`"
#' output: github_document
#' ---
@cosmocatalano
cosmocatalano / instagram_scrape.php
Last active February 8, 2025 07:43
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}