Skip to content

Instantly share code, notes, and snippets.

View prio101's full-sized avatar
:shipit:
Making Stuff

Mahabub Islam Prio prio101

:shipit:
Making Stuff
View GitHub Profile
@prio101
prio101 / the_builder_of_things.rb
Created April 2, 2021 01:09 — forked from Insti/the_builder_of_things.rb
A Ruby solution to "The builder of things" codewars kata
# https://www.codewars.com/kata/the-builder-of-things/ruby
# https://www.codewars.com/kata/reviews/5571e09a385f59d95f000063/groups/59426d64e6049310a70006ce
# imported to handle any plural/singular conversions
require 'active_support/core_ext/string'
class Thing
def initialize(name)
@properties = {}
is_the.name.send(name)
@prio101
prio101 / postgres-cheatsheet.md
Created April 21, 2016 16:16 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@prio101
prio101 / vim_cheatsheet.md
Created March 17, 2016 18:12 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
<?php
#!/usr/bin/env php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
set_time_limit(0);
$dir = $argv[1];
$source = $argv[2];
print_r($argv);
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';