Skip to content

Instantly share code, notes, and snippets.

View Dottenpixel's full-sized avatar

dugg molidor Dottenpixel

View GitHub Profile
<?php
require("postmark.php");
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address");
$result = $postmark->to("[email protected]")
->subject("Email Subject")
->plain_message("This is a plain text message.")
->attachment('File.pdf', $file_as_string, 'application/pdf')
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm git
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
// regexp for matching a valid email and populating an array with its parts
'[email protected]'.match(/([a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*)+\@([a-z0-9-]+)\.([a-z.]{2,})/)
// returns ['[email protected]', 'e.mail-address', 'my-domain', 'co.us']
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
# http://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection
namespace :db do
desc "Fix 'database is being accessed by other users'"
task :terminate => :environment do
ActiveRecord::Base.connection.execute <<-SQL
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
# A module that allows us to send Backbone events up the tree of components
ReactTelegraph =
componentWillMount: ->
# Make BB events available to the component
_.extend @, Backbone.Events
componentWillUnmount: ->
# Remove all Backbone event listeners
@off null, null, null
@Dottenpixel
Dottenpixel / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@Dottenpixel
Dottenpixel / promises.md
Created February 2, 2016 23:25 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@Dottenpixel
Dottenpixel / reducers.js
Last active February 4, 2016 07:03 — forked from gaearon/reducers.js
How I'd do code splitting in Redux (pseudo code, not tested!) Referred by: https://github.com/rackt/redux/issues/37#issue-85098222
import { combineReducers } from 'redux';
import users from './reducers/users';
import posts from './reducers/posts';
export default function createReducer(asyncReducers) {
return combineReducers({
users,
posts,
...asyncReducers
});
@Dottenpixel
Dottenpixel / dabblet.css
Last active April 14, 2016 19:15 — forked from anonymous/dabblet.css
Untitled
div{
position: relative;
display:block;
padding:5px;
margin:10px;
border:1px solid #ccc;
transition: 0s background-color;
div {
position: absolute;
top: -5px;