Skip to content

Instantly share code, notes, and snippets.

View yelkhatib's full-sized avatar

Yehia Elkhatib yelkhatib

View GitHub Profile
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@cvitolo
cvitolo / ts2years.R
Last active August 29, 2015 14:10
Split long time series into (hydrological) years in R
# Load library
library(xts)
# Generate dummy time series
from <- as.Date("1950-01-01")
to <- as.Date("1990-12-31")
myDates <- seq.Date(from=from,to=to,by="day")
myTS <- as.xts(runif(length(myDates)),order.by=myDates)
# SPLIT THE TIME SERIES INTO CALENDAR YEARS
@jrsmith3
jrsmith3 / doi2bib.py
Last active May 17, 2024 17:43
Python method to access crossref.org DOI bibtex metadata resolver
import requests
def doi2bib(doi):
"""
Return a bibTeX string of metadata for a given DOI.
"""
url = "http://dx.doi.org/" + doi
headers = {"accept": "application/x-bibtex"}
#!/bin/bash
NET=10.0.0.0/16
# i.e. 256Kbit/s
RATE_OUT=$1
# i.e. 6Mbit/s
RATE_IN=$2
DELAY_IN=$3
DELAY_OUT=$4
anonymous
anonymous / index.html
Created December 30, 2012 08:14
A CodePen by Thibaut Courouble. Sliding Tags - By [WebInterfaceLab](http://www.webinterfacelab.com): a collection of free [CSS code snippets](http://www.webinterfacelab.com/snippets). View the original article and download the Sass/SCSS source at: [www.webinterfacelab.com/snippets/sliding-tags](http://www.webinterfacelab.com/snippets/sliding-tags)
<div class="container">
<ul class="tags">
<li><a href="#">Interface <span>4</span></a></li>
<li><a href="#">Icon <span>8</span></a></li>
<li><a href="#">Typography <span>15</span></a></li>
<li><a href="#">Color <span>16</span></a></li>
</ul>
<ul class="tags green">
<li><a href="#">Design <span>23</span></a></li>
@sgmurphy
sgmurphy / podcast-ratings.php
Created February 21, 2012 19:31
Scrape ratings from iTunes store
<?php
/**
* Scrape the number of podcast reviews from iTunes for all country specific storefronts.
*
* @author Sean Murphy <sean@iamseanmurphy.com>
*/
$podcast_id = '366931951'; // Startups For the Rest of Us
//$podcast_id = '318567721'; // techzing