Skip to content

Instantly share code, notes, and snippets.

View eledroos's full-sized avatar

nasser eledroos

View GitHub Profile
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@akimach
akimach / conv.sh
Created September 13, 2017 06:20
Jupyter Notebook to docx(Word)
curl -O https://gist.githubusercontent.com/akimach/27e87cb7f97dc253921b9ea8b7b332b5/raw/fd112a66a3ca953dd7ad26098cccfe1d532ba0d7/binominal_confidience_interval.ipynb
jupyter-nbconvert binominal_confidience_interval.ipynb --to markdown
pandoc binominal_confidience_interval.ipynb -t docx -o binominal_confidience_interval.docx

Got Retweets?

Even though Twitter's statuses/retweets API endpoint is limited to the last 100 retweets it is possible to use the search/tweets endpoint to search for the retweets using the text of the tweet. Caveat: This is only possible for tweets that have happened in the last 7 days, which is furthest back Twitter allow you to search for tweets in.

For example here is how you can get the retweets for this tweet and analyze the users in a spreadsheet.

# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat
# Originally seen at http://spatial.ly/2014/08/population-lines/
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess,
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line.
# The result of the code below can be seen at http://imgur.com/ob8c8ph
library(tidyverse)
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active April 23, 2024 02:03
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS