This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'active_support/all' | |
ACTIVE_CASES = 25000000.to_f | |
TOTAL_WORLD_CASES = 260000000.to_f | |
INCUBATION_DAYS = 3 | |
RECOVERY_DAYS = 10 | |
WORLD_POPULATION = 8600000000 | |
R = 1.135 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="page-width"> | |
{%- for group in groups -%} | |
<div class="product-recommendations__inner"> | |
<div class="section-header text-center"> | |
<h2>{{ group.label }}</h2> | |
</div> | |
<ul class="grid grid--uniform grid--view-items"> | |
{%- for product in group.products -%} | |
<li class="grid__item small--one-half medium-up--one-quarter"> | |
{% include 'product-card-grid', max_height: 250, product: product, show_vendor: false %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import glob | |
import sqlite3 | |
import datetime | |
import urllib.parse | |
import re | |
import shutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef HOST_MULTIOUT_H_INCLUDED | |
#define HOST_MULTIOUT_H_INCLUDED | |
#include <memory> | |
#include <string> | |
namespace Host | |
{ | |
class MultiOut | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct { | |
int foo; | |
int bar; | |
} MediaTrack; | |
typedef union { | |
long l; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-hook 'c++-mode-hook | |
(lambda () | |
(if (not (boundp 'cmake-ide-build-dir)) | |
(let* ((cmake-lists (locate-dominating-file default-directory "CMakeLists.txt")) | |
(cmake-build (concat cmake-lists "build"))) | |
(if (and cmake-lists (file-exists-p cmake-build)) | |
(progn | |
(setq cmake-ide-build-dir cmake-build) | |
(global-set-key (kbd "s-.") 'cmake-ide-compile))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'mysql2' | |
DATABASE, PREFIX = ARGV | |
client = Mysql2::Client.new(username: 'root', database: DATABASE) | |
tables = client.query("select table_name from information_schema.tables " + | |
"where table_schema='#{DATABASE}' and table_name like '#{PREFIX}%'", | |
as: :array).map(&:first) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(convert_paths_to_absolute input output) | |
set(paths "") | |
foreach(source ${input}) | |
get_filename_component(absolute ${source} ABSOLUTE ${CMAKE_SOURCE_DIR}) | |
list(APPEND paths ${absolute}) | |
endforeach() | |
set(${output} "${paths}" PARENT_SCOPE) | |
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
int main(int argc, const char *argv[]) | |
{ | |
if(geteuid() != 0) | |
{ | |
fprintf(stderr, "This program should be setuid or run as root.\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'parser/current' | |
module Parser | |
module AST | |
class Node | |
def find(type, found: [], &block) | |
if self.type == type && (!block || block.call(self)) | |
found.push(self) |
NewerOlder