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 | |
# Check if an input file is provided | |
if [[ -z "$1" ]]; then | |
echo "Usage: extract-first-frame.sh input.mp4 [output.jpg] [frame_number]" | |
exit 1 | |
fi | |
# Set the input file name | |
input_file="$1" |
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
use framework "Foundation" | |
use scripting additions | |
property scpTarget : "[email protected]:~/public_html/uploads" | |
property publicPath : "https://example.com/uploads/" | |
on open fileList | |
repeat with thisFile in fileList | |
set itemPath to the quoted form of the POSIX path of thisFile | |
do shell script ("scp " & itemPath & " " & scpTarget) |
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
########## | |
# Win10 Initial Setup Script | |
# Author: Disassembler <[email protected]> | |
# Version: 1.7, 2016-08-15 | |
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
# THIS IS A PERSONALIZED VERSION | |
# This script leaves more MS defaults on, including MS security features. | |
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1 |
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
require 'httparty' | |
require 'awesome_print' | |
require 'enumerator' | |
USER_ID = "kenmickles" | |
ACCESS_TOKEN = "" | |
PLAYLIST_ID = "" | |
def search_for_track(query) | |
response = HTTParty.get("https://api.spotify.com/v1/search", |
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
RewriteEngine On | |
RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source] |
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
require 'csv' | |
CSV.read("credits.csv").each_with_index do |line, i| | |
line.each { |s| s.gsub!("'", "’") unless s.nil? } | |
if i == 0 | |
puts "[TTL]#{line[0].upcase!}" | |
elsif line.compact.length > 0 | |
puts "\n" if line[0] | |
line[1].upcase! if line[1] |
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
/* Option 1: right align the menu on just the blog page */ | |
.blog-sidebar-left #topNav { | |
width: 1000px; | |
max-width: 100%; | |
text-align: center; | |
margin: 0 auto; | |
float: none; | |
} | |
.blog-sidebar-left #topNav .main-nav { |
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
require 'open-uri' | |
require 'nokogiri' | |
url = "http://casbah.podomatic.com/rss2.xml" | |
open(url) do |rss| | |
doc = Nokogiri::XML(rss) | |
doc.xpath("//item").each do |item| | |
puts `wget -nc "#{item.xpath('enclosure').attr('url')}"` | |
end | |
end |
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
require 'httparty' | |
facebook_id=[FACEBOOK_ID] | |
access_token=[ACCESS_TOKEN] # See https://developers.facebook.com/tools/access_token/ | |
puts HTTParty.get("https://graph.facebook.com/#{facebook_id}/friends?access_token=#{access_token}&limit=1000")['data'].map { |f| f['id'] }.inspect |
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 | |
TOKEN="Get token from https://cloud.digitalocean.com/settings/applications" | |
DOMAIN=example.com | |
RECORD_ID=12345 | |
IP=`curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'` | |
# to get record id: | |
# curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" "https://api.digitalocean.com/v2/domains/$DOMAIN/records" |
NewerOlder