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"?> | |
| <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> | |
| <channel> | |
| <title>Petrolicious</title> | |
| <link>https://staging.petrolicious.com</link> | |
| <description>Petrolicious is a leading automotive lifestyle brand providing world class short films and tasteful editorial around the world’s finest classic vehicles.</description> | |
| <language>en-us</language> | |
| <copyright>© Petrolicious / May Moon Media 2018. All Rights reserved.</copyright> | |
| <atom:link href="https://staging.petrolicious.com/feed" rel="self" type="application/rss+xml"/> | |
| <item> |
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
| import Ember from 'ember'; | |
| import Utils from 'docket/utils'; | |
| import Status from 'docket/models/status'; | |
| import User from 'docket/models/user'; | |
| export default Ember.Route.extend({ | |
| activate: function() { | |
| this._super(); | |
| // do some setup related to event_source here | |
| }, |
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
| adjust_by = 48 # seconds | |
| srt = File.read(File.expand_path("~/Downloads/EN.srt")) | |
| new_srt = srt. | |
| split("\r\n\r\n"). | |
| map {|s| s.split("\r\n")}. | |
| map do |i, times, *values| | |
| new_times = times.split(" --> ").map {|t| (Time.strptime(t, "%H:%M:%S,%L") + adjust_by).strftime("%H:%M:%S,%L")}.join(" --> ") |
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 OR REPLACE FUNCTION update_notify() RETURNS trigger AS $$ | |
| DECLARE | |
| channel text; | |
| BEGIN | |
| channel := TG_ARGV[0]; | |
| NOTIFY channel; | |
| RETURN NEW; | |
| END; | |
| $$ LANGUAGE plpgsql; |
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
| traceroute to gp1.wac.v2cdn.net (72.21.91.8), 64 hops max, 52 byte packets | |
| 1 10.194.112.1 (10.194.112.1) 1.668 ms 1.234 ms 1.043 ms | |
| 2 * * * | |
| 3 * * * | |
| 4 * * * | |
| 5 * * * | |
| 6 * * * | |
| 7 * * * | |
| 8 * * * | |
| 9 * * * |
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
| Required: dm-core | |
| Is inherited public or private in A | |
| public | |
| Required: dm-active_model | |
| Is inherited public or private in B | |
| public | |
| Required: dm-rails | |
| Is inherited public or private in C |
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
| #!/usr/bin/env ruby | |
| require 'trello' # ruby-trello gem | |
| require 'csv' | |
| # | |
| # export TRELLO_DEVELOPER_PUBLIC_KEY=yourkeyfrom # https://trello.com/app-key | |
| # export BOARD_NAME=nameofboardtoimportto | |
| # export MEMBER_NAME=yourusername |
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 OR REPLACE VIEW next_episode_ids AS ( | |
| SELECT id, ROW_NUMBER() OVER(PARTITION BY show_id ORDER BY airs_on) AS r | |
| FROM episodes | |
| WHERE airs_on >= NOW() | |
| ); | |
| CREATE OR REPLACE VIEW next_episodes AS ( | |
| SELECT * FROM episodes WHERE id IN ( | |
| SELECT id FROM next_episode_ids WHERE r = 1 | |
| ) |
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
| import sublime_plugin | |
| class AlwaysCenterCommand(sublime_plugin.EventListener): | |
| def on_modified(self, view): | |
| sel = view.sel() | |
| region = sel[0] if len(sel) == 1 else None | |
| if region != None: | |
| view.show_at_center(region) |
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
| # http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-default_proc-3D | |
| h = Hash.new {|hash, key| hash[key] = Hash.new(&hash.default_proc)} | |
| h[:foo][:bar][:baz][:bat] = "hello" | |
| p h | |
| #=> {:foo=>{:bar=>{:baz=>{:bat=>"hello"}}}} |
NewerOlder