Skip to content

Instantly share code, notes, and snippets.

@gka
gka / presenter.html
Created December 13, 2012 22:36
Simplified version of flickrperson app. See https://github.com/PyBossa/pybossa.js/issues/8 for more information.
<h2>Do you see a human in this photo?</h2>
<div class="img-container"></div>
<button class="btn btn-large btn-success">Yes</button>
<button class="btn btn-large btn-danger">No</button>
<button class="btn btn-large btn-maybe">I don't know</button>
<script>
@doitian
doitian / README.md
Created December 20, 2012 08:21
Expose local ports via server through ssh port forward
  • Change server sshd_config to allow client binding artitray network interface

    GatewayPorts yes
    
  • Use -R [bind_address:]port:host:hostport to setup port forwarding. bind_address should be 0.0.0.0, which means binding on all network addresses. Following example forward local ports 3000 to server 8080, and local ports 22 to server 2222. So others can open http://server:8080 to access your web server, and ssh -p 2222 server to log into your local machine.

    ssh -R 0.0.0.0:8080:localhost:3000 -R 0.0.0.0:2222:localhost:22 server
    
@tototoshi
tototoshi / rownum.sql
Created December 26, 2012 01:14
Grouped LIMIT in PostgreSQL: show the first N rows for each group
-- http://stackoverflow.com/questions/1124603/grouped-limit-in-postgresql-show-the-first-n-rows-for-each-group
-- http://www.postgresql.jp/document/9.2/html/tutorial-window.html
CREATE TABLE empsalary (
depname varchar(10) not null
, empno integer not null
, salary integer not null
);
INSERT INTO empsalary (depname, empno, salary) VALUES ('develop', 11, 5200);
@iaian
iaian / sublimeText2_contextMenu.reg
Last active January 15, 2019 15:46
Add SublimeText 2 context menu to windows explorer. If item is folder, context menu has option "open in sublimetext project". If is file, "open in sublime text 2" option is added to context menu. Tested on windows 7
Windows Registry Editor Version 5.00
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="Open Folder as Sublime Project"
"Icon"="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
@willurd
willurd / web-servers.md
Last active August 22, 2026 05:03
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@chuckreynolds
chuckreynolds / wordpress-change-domain-migration.sql
Last active July 7, 2025 12:20
UPDATE: Use WP-CLI find-replace command to edit URLs in your database. https://developer.wordpress.org/cli/commands/search-replace/ Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: al…
/* Use WP-CLI instead https://developer.wordpress.org/cli/commands/search-replace/ */
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
@mwhite
mwhite / git-aliases.md
Last active August 15, 2026 00:53
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@msurguy
msurguy / List.md
Last active July 2, 2026 11:32
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

public function mimeIsAmong( $error_msg )
{
$r_conditions = array(
"image/png" ,
"image/jpg" ,
"image/jpeg" ,
"image/gif" ,
"application/pdf" ,
"application/msword" ,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" );
@roundand
roundand / OpenWithSublimeText3.bat
Last active April 30, 2026 22:30 — forked from mrchief/LICENSE.md
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f