Skip to content

Instantly share code, notes, and snippets.

View codebryo's full-sized avatar
🚀
...

Roman Kuba codebryo

🚀
...
View GitHub Profile
@hyperupcall
hyperupcall / change-master-branch-to-main.sh
Last active May 14, 2021 04:35
Cross-platform shell script to change the 'master' branch to 'main' for the local and remote repository
#!/bin/sh -eu
# code licensed under BSD 2-Clause "Simplified" License
# see `change-master-branch-to-main.sh --help` for usage
# see twitter thread for more details: https://twitter.com/EdwinKofler/status/1272729160620752898
site="github.com"
oldDefaultBranch="master"
newDefaultBranch="main"
@alxy
alxy / GenerateCommand.php
Created August 30, 2013 20:15
Simple aidkit generator...
<?php namespace Codebryo\Aidkit\Commands;
use Illuminate\Console\Command;
use \File;
use Illuminate\Support\Pluralizer;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class GenerateCommand extends Command {
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;font-size:16px}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/php");</script>
@tamagokun
tamagokun / router.php
Last active March 12, 2020 11:15
Run a Wordpress site via PHP's built-in web server
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
chdir($root);
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
set_include_path(get_include_path().':'.__DIR__);
if(file_exists($root.$path))
{
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
$path = rtrim($path,'/').'/index.php';
@fatihacet
fatihacet / pubsub-simple.js
Created October 15, 2011 22:02
Simple PubSub implementation with JavaScript - taken from Addy Osmani's design patterns book -
var pubsub = {};
(function(q) {
var topics = {}, subUid = -1;
q.subscribe = function(topic, func) {
if (!topics[topic]) {
topics[topic] = [];
}
var token = (++subUid).toString();
topics[topic].push({
token: token,
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')