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
#!/bin/bash | |
#sudo -i | |
cd /tmp | |
printf "Add repositories" | |
sudo apt-get install software-properties-common | |
sudo sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo add-apt-repository ppa:webupd8team/sublime-text-3 | |
sudo add-apt-repository ppa:nginx/stable | |
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db |
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
# losslessly concat mp4 files | |
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts | |
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts | |
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4 | |
# concat files with the same format | |
# 1. create a file list | |
file '/path/to/file1' | |
file '/path/to/file2' | |
file '/path/to/file3' |
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
var exec = require('child_process').exec; | |
var url = 'https://URL'; | |
var command = 'curl --silent ' + url + '| ffprobe pipe:0 -print_format json -show_format'; | |
exec(command, function callback(error, stdout, stderr){ | |
if(stderr.indexOf("Invalid data") > -1) { | |
console.log("Error!"); | |
} |
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
These are the steps that were previously in the question - they have been migrated to this answer. | |
Having found that it is possible to generate a Facebook Page Access Token that does not expire (with help from @Igy), here is a clear, step-by-step quide for all those looking to the same: | |
Make sure you are the admin of the FB page you wish to pull info from | |
Create a FB App (should be with the same user account that is the page admin) | |
Head over to the Facebook Graph API Explorer | |
On the top right, select the FB App you created from the "Application" drop down list | |
Click "Get Access Token" | |
Make sure you add the manage_pages permission | |
Convert this short-lived access token into a long-lived one by making this Graph API call: https://graph.facebook.com/oauth/access_token?client_id=<your FB App ID >&client_secret=<your FB App secret>&grant_type=fb_exchange_token&fb_exchange_token=<your short-lived access token> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- https://gist.github.com/kalehv/bae765c756e94455ed88 --> | |
<resources> | |
<color name="red_50">#ffebee</color> | |
<color name="red_100">#ffcdd2</color> | |
<color name="red_200">#ef9a9a</color> | |
<color name="red_300">#e57373</color> | |
<color name="red_400">#ef5350</color> | |
<color name="red_500">#f44336</color> |
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
http { | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; | |
proxy_temp_path /var/tmp; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
gzip_comp_level 6; |
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
var request = require('request-promise'); | |
var crypto = require('crypto'); | |
var config = {...}; | |
function getAccessToken(cookies) { | |
var cookieName = 'fbsr_' + config.client_id; | |
var signedRequest = cookies[cookieName]; | |
var code = getCode(signedRequest); | |
return exchangeCodeForAccessToken(code); | |
}; |
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
xcodebuild -exportArchive -exportFormat ipa -archivePath {PATH}/MyApp.xcarchive -exportPath ~/Desktop/MyApp.ipa |
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
find . -name "fgh*" -type f -print0 | xargs -0 -I {} sh -c 'mv "{}" "$(dirname "{}")/`echo $(basename "{}") | sed 's/^fgh/jkl/g'`"' |
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
import {Component} from '@angular/core'; | |
import { | |
ActionSheetController, | |
AlertController, | |
IonicPage, | |
LoadingController, | |
ModalController, | |
NavParams, | |
ToastController | |
} from 'ionic-angular'; |
OlderNewer