Skip to content

Instantly share code, notes, and snippets.

View mrhili's full-sized avatar
🎯
Focusing

Mrhili Mohamed Amine mrhili

🎯
Focusing
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
#include <string.h>
void print_at_xy(int x, int y, char *val);
void display_score();
void init();
int zero_lives();
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
@hrbrmstr
hrbrmstr / code_ex.r
Created March 6, 2016 16:31
hack-ish way to get all the code examples from your package
fil <- list.files("man", full.names=TRUE)
cat(sapply(fil, function(x) {
rd <- tools::parse_Rd(x)
ex <- rd[devtools:::rd_tags(rd) == "examples"]
trimws(paste0(devtools:::process_ex(ex, run=FALSE), sep="", collapse="\n"))
}, USE.NAMES=FALSE))
@James1x0
James1x0 / momentjs.humanized.triplesplit.time.js
Created January 15, 2014 19:42
Get a humanized, "Morning", "Afternoon", "Evening" from moment.js **Great for user greetings!**
function getGreetingTime (m) {
var g = null; //return g
if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return.
var split_afternoon = 12 //24hr time to split the afternoon
var split_evening = 17 //24hr time to split the evening
var currentHour = parseFloat(m.format("HH"));
if(currentHour >= split_afternoon && currentHour <= split_evening) {
@erberg
erberg / HTML - Starter Template
Created May 21, 2013 19:09
HTML Starter Template
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->