Skip to content

Instantly share code, notes, and snippets.

View BogdanDogaru's full-sized avatar

Bogdan Dogaru BogdanDogaru

  • London, UK
View GitHub Profile
#!/bin/bash
# Usage:
# ./charles.sh on
# ./charles.sh off
# sed needs write permissions to the parent folder to create temp file
sudo chmod -R 777 /usr/share/php/Zend/Http/Client/Adapter
sudo chmod -R 777 /usr/share/php/BBC/Http/Multi/Client/Adapter/
if [ $1 = "on" ]; then
@paulirish
paulirish / bling.js
Last active January 30, 2026 14:23
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
<?php
/**
* Similar to print_r(), except that it writes to /tmp/rawlog.log. This function is
* intended for debugging, where you want to be absolutely sure that your output
* is not being captured or buffered or otherwise interfered with.
*
* One good way to ensure this is always available is to use the auto_prepend_file
* php.ini setting.
*/

Typographic glyphs

via

Shortcuts and proper use

name glyph mac other description
curly single quotes ‘ ’ Option+] and Shift+Option+] ALT-0145 and ALT-0146 hover for description
curly double quotes “ ” Option+[ and Shift+Option+[ ALT-0147 and ALT-0148 -
@jreinke
jreinke / generate.php
Created August 14, 2012 14:45
Default password encoding in Silex micro-framework
<?php
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
$encoder = new MessageDigestPasswordEncoder();
echo $encoder->encodePassword('foo', '');
// 5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==
@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')