- Issue the following commands from the command line in your Yii application directory:
chmod +x shell
mkdir extensions/yiishell
wget -O extensions/yiishell/psysh psysh.org/psysh
chmod +x extensions/yiishell/psysh
- Copy the file
init.php
below toextensions/yiishell/init.php
and update any paths to work with your application configuration - Copy the file
config.php
below toextensions/yiishell/config.php
. Change or add to the config array with the options you'd like to use (available options) - Now you can start PsySH with the command
extensions/yiishell/psysh extensions/yiishell/init.php --config extensions/yiishell/config.php
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
/* | |
* BarTab integration - Vimperator Plugin | |
* | |
* Commands: | |
* :tap tap the current tab | |
* :tap # tap the previous seleced tab | |
* :tap {num}:? tap the {num}-th tab | |
* :tap! tap all tabs without the current tab | |
* | |
* Tab Completion is available !! |
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
#!/usr/local/bin/ruby | |
grep = `git grep -n #{ARGV[0]} #{ARGV[1]}` | |
puts "\n-----------------------------------------------------------" | |
puts "GREP RESULT" | |
puts '-----------------------------------------------------------' | |
puts grep | |
files = grep.scan /.*\:\d+/ |
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 | |
namespace Roots\Sage\Nav; | |
use Roots\Sage\Utils; | |
/** | |
* Cleaner walker for wp_nav_menu() | |
* | |
* Walker_Nav_Menu (WordPress default) example output: |
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
iex(1)> defmodule Util do | |
...(1)> def tap(input, func) do | |
...(1)> func.(input) | |
...(1)> input | |
...(1)> end | |
...(1)> end | |
{:module, Util, | |
<<70, 79, 82, 49, 0, 0, 4, 212, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 164, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>, | |
{:tap, 2}} | |
iex(2)> import Util |
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
defmodule Parser do | |
@moduledoc """ | |
Sample parser for article on: | |
http://stefan.lapers.be/posts/elixir-writing-an-expression-parser-with-nimble-parsec/ | |
""" | |
import NimbleParsec | |
not_ = string("!") |> label("!") | |
and_ = string("&&") |> replace(:&&) |> label("&&") | |
or_ = string("||") |> replace(:||) |> label("||") |
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
defp upsert_profile(multi, source, source_uuid, profile_url) do | |
profile = %Profile{ | |
source: source, | |
source_uuid: source_uuid, | |
profile: profile_url, | |
} | |
Ecto.Multi.insert(multi, source_uuid, profile, on_conflict: [set: [profile: profile_url]], conflict_target: [:source, :source_uuid]) | |
end |
If you are using vagrant, you probably-statistically are using git. Make sure you have its binary folder on your path, because that path contains 'ssh.exe'.
Now, modify C:\vagrant\vagrant\embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\ssh.rb
to comment out the faulty Windows check and add a real SSH check:
# if Util::Platform.windows?
# raise Errors::SSHUnavailableWindows, :host => ssh_info[:host],
# :port => ssh_info[:port],
# :username => ssh_info[:username],
# :key_path => ssh_info[:private_key_path]
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 | |
require_once "jBBCode" . DIRECTORY_SEPARATOR . "Parser.php"; | |
/** | |
* Implements a [list] code definition that provides the following syntax: | |
* | |
* [list] | |
* [*] first item | |
* [*] second item |
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() { | |
d3.force_labels = function force_labels() { | |
var labels = d3.layout.force(); | |
// Update the position of the anchor based on the center of bounding box | |
function updateAnchor() { | |
if (!labels.selection) return; | |
labels.selection.each(function(d) { | |
var bbox = this.getBBox(), | |
x = bbox.x + bbox.width / 2, |
OlderNewer