Skip to content

Instantly share code, notes, and snippets.

View salaros's full-sized avatar
🎉
Making magic happen

Yaroslav Zhmayev salaros

🎉
Making magic happen
View GitHub Profile
@tverboon
tverboon / opencover.build
Created July 18, 2016 06:05
Use OpenCover with .Net Core in MSBuild
<PropertyGroup>
<NuGetPackageDir>$(UserProfile)\.nuget\packages\</NuGetPackageDir>
<OpenCover>$(NuGetPackageDir)OpenCover\4.6.519\tools\OpenCover.Console.exe</OpenCover>
<XUnitConsolePath>$(NuGetPackageDir)xunit.runner.console\2.2.0-beta2-build3300\tools\xunit.console.exe</XUnitConsolePath>
<CoverageConverter>$(NuGetPackageDir)OpenCoverToCoberturaConverter\0.2.4\tools\OpenCoverToCoberturaConverter.exe</CoverageConverter>
</PropertyGroup>
<Target Name="Test">
<MakeDir Directories="$(TestResultsPath)" Condition = "!Exists('$(TestResultsPath)')" />
<ItemGroup>
@jayrulez
jayrulez / country-code-to-currency-code-mapping.csv
Created July 14, 2016 02:46 — forked from HarishChaudhari/country-code-to-currency-code-mapping.csv
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
@petrbel
petrbel / .travis.yml
Last active October 26, 2019 10:29 — forked from iedemam/gist:9830045
Travis-CI submodules
# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior!
# disable the default submodule logic
git:
submodules: false
# use sed to replace the SSH URL with the public URL, then init and update submodules
before_install:
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
@hubgit
hubgit / file-exists-ci.php
Created June 28, 2010 16:10
Check if a file exists, with case-insensitive file name.
<?php
function file_exists_ci($file) {
if (file_exists($file))
return $file;
$lowerfile = strtolower($file);
foreach (glob(dirname($file) . '/*') as $file)
if (strtolower($file) == $lowerfile)
@kashimAstro
kashimAstro / README.md
Last active May 5, 2021 17:47
H3 / Mali GPU driver and openframeworks armv7 ES / ES2

#A small guide to compile openFrameworks armv7 with driver OpenGL ES / ES2 sunxi for H3 / Mali GPU on ARMBIAN OS, compatible with orangepi and bananapi.

tested on: orangepi one banana pi M2

dependencies:

apt-get install libx11-dev libxext-dev xutils-dev libdrm-dev \ 
           x11proto-xf86dri-dev libxfixes-dev x11proto-dri2-dev xserver-xorg-dev \
 build-essential automake pkg-config libtool ca-certificates git cmake subversion
@phuphighter
phuphighter / mediaqueries.css
Created June 29, 2016 14:10
Semantic UI friendly media queries
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
[class*="tablet only"]:not(.mobile),
[class*="computer only"]:not(.mobile),
[class*="large screen only"]:not(.mobile),
[class*="widescreen only"]:not(.mobile),
[class*="or lower hidden"] {
display: none !important;
}
@elclanrs
elclanrs / email-confirmation.php
Last active July 26, 2022 00:11
Simple e-mail confirmation plugin for WordPress.
<?php
/**
* Plugin Name: Email Confirmation
* Description: Send an email to the user with confirmation code and store form data in database until user confirms.
* Author: Cedric Ruiz
*/
class EmailConfirmation
{
const PREFIX = 'email-confirmation-';
@salaros
salaros / BytesHelper.cs
Last active June 9, 2023 14:11
Comparing two arrays of bytes in C#
public static class BytesHelper
{
// Copyright (c) 2008-2013 Hafthor Stefansson
// Distributed under the MIT/X11 software license
// Ref: http://www.opensource.org/licenses/mit-license.php.
public static unsafe bool Equals(byte[] a1, byte[] a2)
{
if (a1 == a2)
return true;
@sebastienros
sebastienros / PortableObject-NETCore.md
Last active September 27, 2023 01:01
Configuring Portable Object localization in ASP.NET Core

Configuring Portable Object localization in ASP.NET Core

The package which is used in this article is avaible on MyGet on this url: https://www.myget.org/F/orchardcore-preview/api/v3/index.json

This article walks you through the steps for using Portable Object files (PO files) inside your ASP.NET Core application.

What is a PO file

PO files are files that contain the translated strings for a given language. They reveal very useful as contrary to standard resx files, PO files support pluralization and are distributed as text files.

@anotheremily
anotheremily / find-base64-occurences
Created December 6, 2010 22:25
hackers seem to like base64 encoding their php commands
#!/bin/bash
find . -name "*.php" -exec grep "base64" '{}' \; -print &> b64-detections.txt
find . -name "*.php" -exec grep "eval" '{}' \; -print &> eval-detections.txt