This file contains hidden or 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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
This file contains hidden or 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
public static class DbContextExtensions | |
{ | |
public static void LogToConsole(this DbContext context) | |
{ | |
IServiceProvider contextServices = ((IDbContextServices)context).ScopedServiceProvider; | |
var loggerFactory = contextServices.GetRequiredService<ILoggerFactory>(); | |
loggerFactory.AddConsole(LogLevel.Verbose); | |
} | |
} |
This file contains hidden or 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
# single convert | |
convert -density 150 File.ai preview.png | |
# batch convert | |
dir -recurse -include *.ai | %{ mogrify -density 150 -format png $_.FullName } | |
# run as powershell command (wrap) | |
powershell -Command 'dir -recurse -include *.ai | %{ mogrify -density 150 -format png $_.FullName }' |
This file contains hidden or 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 current folder only | |
git add *.png | |
# include sub folders only | |
git add **/*.png | |
# include both current and sub folders | |
git add *.png | |
git add **/*.png |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<packageSources> | |
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2/" /> | |
<add key="nuget.org" value="https://www.nuget.org/api/v2/" /> | |
</packageSources> | |
<disabledPackageSources /> | |
<activePackageSource> | |
<add key="nuget.org" value="https://www.nuget.org/api/v2/" /> | |
</activePackageSource> |
This file contains hidden or 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
# Get rpi-source... easier than dkms shenanigans with headers from here | |
# https://www.niksula.hut.fi/~mhiienka/Rpi/linux-headers-rpi | |
sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update | |
# Clean anything from a previous install | |
sudo rm -rfv /usr/src/4.4.11-v7 | |
sudo install bc |
This file contains hidden or 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
// create image (in working directory) | |
docker run -v "$(pwd):/usr/src/app" -p "4000:4000" starefossen/github-pages | |
// run container | |
docker start -i blog |
This file contains hidden or 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
<?php | |
// create folder | |
$backupfile = 'dest_folder_name/file_name_' . date("Y-m-d") . '.tar.gz'; | |
system("tar -czf $backupfile src_folder"); | |
// database backup | |
$dbhost = "localhost"; // usually localhost | |
$dbuser = "user_name"; |
This file contains hidden or 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
# stream video | |
ffmpeg -re -i live.mp4 -c:v libx264 -preset veryfast -maxrate 3000k \ | |
-bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 \ | |
-ar 44100 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/" | |
# stream desktop | |
ffmpeg -video_size 1366x768 -framerate 25 -f x11grab -i :0.0 -ar 44100 -f alsa -ac 2 -i hw:0 -preset ultrafast output.mp4 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/" |
This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<!-- Main Meta Tags --> | |
<meta charset="utf-8" /> | |
<title>PAGE TITLE</title> | |
<meta name="description" content="PAGE TITLE" /> | |
<meta property="og:site_name" content="PAGE TITLE"> |
OlderNewer