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
# Save to a new file with a ".ps1" extension | |
$files = "D:\videos\" | |
foreach ($f in Get-ChildItem $files) { | |
# I have to define the h264 video codec because it fails converting GoPro videos without this option. | |
auto-editor --no-open --margin 0.2sec --video-codec h264 $(Join-Path -Path $files -ChildPath $f) | |
} |
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
** Invoke bundler:install (first_time) | |
** Invoke bundler:config (first_time) | |
** Execute bundler:config | |
01:32 bundler:config | |
01 $HOME/.rbenv/bin/rbenv exec bundle config --local deployment true | |
✔ 01 [email protected] 0.968s | |
02 $HOME/.rbenv/bin/rbenv exec bundle config --local path /path/to/project/shared/bundle | |
✔ 02 [email protected] 0.874s | |
03 $HOME/.rbenv/bin/rbenv exec bundle config --local without development:test | |
✔ 03 [email protected] 1.099s |
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
class Robot | |
MOVES = { | |
L: 'move_left', | |
R: 'move_right', | |
F: 'move_forward' | |
} | |
DIRECTIONS = ['N', 'E', 'S', 'W'] | |
def initialize position |
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
<?php | |
define('API_ACCESS_KEY', 'AIzaSyA18itgZWVpD0zJ9ynRFHkVlpEIVRhzQGw'); | |
$to = 'dZ0oX5R8nU4:APA91bHDLDsBZk7P76bRqNkiwWEhksd58QywCy2c0v-8HPuuwLN4SHdkFE5CMmgk5N-kzvGzWvxUafAlgDVnNagc9ZJf0BAxrdhmbScbsYojEEg5T750FPfne6VkA0rkD3Ix8jJbwtON'; | |
$notification = array | |
( | |
'body' => 'here is a message. message', | |
'title' => 'This is a title. title', | |
'sound' => 1 | |
); | |
$data = array |
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
task 'assets:precompile:before' do | |
require 'uglifier' | |
require 'sprockets' | |
require 'term/ansicolor' | |
include Term::ANSIColor | |
unless %w{production}.include? Rails.env | |
print yellow(bold("rake assets:precompile should only be run in RAILS_ENV=production, you are risking unminified assets")), "\n" | |
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
import UIKit | |
import RealmSwift | |
import TTTabBar | |
let realm = try! Realm() | |
let octoClient = OctolyClient( | |
baseUrl: "https://www.octoly.com/api", | |
apiVersion: "v1") | |
var currentUser:User? = realm.objects(User).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
- prefix = Rails.env.production? ? '' : (Rails.env + ":") | |
:javascript | |
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0. |
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 drawInfoBulle (style, image, text) { | |
var infoBulle = document.getElementById("infoBulle"), | |
infoBulleImg = document.getElementById("infoBulleImg"), | |
infoBulleTxt = document.getElementById("infoBulleTxt"); | |
infoBulle.style.margin = style; | |
infoBulleImg.innerHTML = image; | |
infoBulleTxt.innerHTML = text; | |
} |
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
If you want your terminal vim to open files you double click, follow the following steps (MacOS only): | |
1. Open Automator | |
2. Select Application | |
3. Copy the attached file | |
4. Save and set as default for opening files | |
Multiple files are opened in vim tabs. | |
If there is already a vim instance running, files are opened in it. |
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
if ( | |
(function(){ | |
var el = document.createElement('div'), | |
bs = 'backgroundSize', | |
ubs = bs.charAt(0).toUpperCase() + bs.substr(1), | |
props = [bs, 'Webkit' + ubs, 'Moz' + ubs, 'O' + ubs]; | |
for ( var i in props ) { | |
if ( el.style[props[i]] !== undefined ) { | |
return true; |
NewerOlder