Skip to content

Instantly share code, notes, and snippets.

@mewm
mewm / pulse.scss
Created August 13, 2015 12:51
Pulsing
@-webkit-keyframes pulse-animation {
0% { -webkit-transform: scale(1); }
50% { -webkit-transform: scale(1.5); }
100% { -webkit-transform: scale(1); }
}
.pulse {
-webkit-animation-name: 'pulse-animation';
-webkit-animation-duration: 2000ms;
-webkit-animation-iteration-count: infinite;
@mewm
mewm / pretty_awesome_stuff.js
Last active January 8, 2019 14:52
omgz, look what awesome stuff you can do with eval() ! PS: NEVER EVER DO SOMETHING LIKE THIS!!!
function saveform()
{
var firstName = escapeSql(mainForm.elements.txtFirstName.value);
var lastName = escapeSql(mainForm.elements.txtLastName.value);
/* ... */
var offerCode = escapeSql(mainForm.elements.txtOfferCode.value);
var code =
' $cn = mssql_connect($DB_SERVER, $DB_USERNAME, $DB_PASSWORD) ' +
' or die("ERROR: Cannot Connect to $DB_SERVER"); ' +
---
- hosts: papi_nodes
sudo: true
gather_facts: yes
vars_files:
- ../vars/local.yml
tasks:
- shell: ls -A /var/www/miinto-papi
register: papidir
roles:
@mewm
mewm / assignment.md
Created June 23, 2015 09:59
miinto dev assignment

#Assignment Spend a few hours starting a small blog application. The objective is not to finish the assignment, but just the overall idea and fundaments of the project. Feel free to use any tools of your likes, and feel free to use interfaces and psuedo code to cover the most trivial implementations (because you're probably already sick and tired of writing simple queries). By psuedo code, I mean that you don't have to spend time writing trivial code like CRUD operations from storage. You can simply just define the methods and write a small comments inside to elaborate its responsibility. This is for us to get an idea how you like to partition your code. Please add at least one unit test.

For example:

class Article
$this->app->bind(
'Esub\Infrastructure\Data\Campaign\CampaignRepository',
function() {
return new CampaignCacheDecorator(App::make('Esub\Infrastructure\Data\Campaign\CampaignDb'));
}
);
var elixir = require('laravel-elixir');
elixir(function(mix)
{
// LESS
mix.less([
// Bootstrap
'bootstrap.less',
stdClass Object
(
[accuracylevel] => ZIP
[parcelshops] => stdClass Object
(
[PakkeshopData] => Array
(
[0] => stdClass Object
(
[Number] => 97853
@mewm
mewm / config.js
Created February 18, 2015 20:15
Generic config.js file for Ghost configurable with environment variables
var config,
url = require('url'),
path = require('path');
function getDatabase() {
var db_config = {};
if (process.env['DB_CLIENT']) {
db_config['client'] = process.env['DB_CLIENT'];
} else {
return {
update table_with_posts p set col_to_update = (
select
col_to_update_from
from
table_to_update_from
where
table_to_update_from.id in (<comma separated ids or select id statement)
order by rand()
limit 1
) where id in (<ids to posts you wanna update>)
@mewm
mewm / loop.js
Created May 17, 2014 13:03
Syncrounous loop in javascript without dependencies
var page = 2;
var last_page = 100;
(function loop() {
if (page <= last_page) {
request("/data?page=" + page, function (error, response, body) {
if (!error && response.statusCode == 200) {
store_data(body)
}
page++;