Skip to content

Instantly share code, notes, and snippets.

View ppeszko's full-sized avatar

Patryk Peszko ppeszko

View GitHub Profile
@ppeszko
ppeszko / .bashrc
Created January 15, 2009 11:27 — forked from boosty/git_status.sh
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
#
# boosty likes it like that:
# ~/dev/dir[master]$ # clean working directory
# ~/dev/dir[master⚡]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "⚡"
}
require 'rubygems'
require 'mongo'
require 'benchmark'
conn = Mongo::Connection.new
db = conn.db("mydb")
coll = db["test"]
# time = Benchmark.realtime do
# 1_000_000.times do
@ppeszko
ppeszko / showAll
Created December 28, 2010 14:14
showAll: bookmark which removes overflow and expand all code snippets, making them more readably
javascript:(function(){var styles='* { overflow: visible !important }';var css=document.createElement('style');css.type='text/css';css.appendChild(document.createTextNode(styles));document.getElementsByTagName("head")[0].appendChild(css);})();
tell application "Skype"
send command "SET USERSTATUS DND" script name "pomodoro"
end tell
tell application "Mail" to quit
tell application "Tweetie" to quit
From PrivateFrameworks/Bom.framework:
U _BOMCopierCopyWithOptions
U _BOMCopierCountFilesInArchive
U _BOMCopierFree
U _BOMCopierNew
U _BOMCopierSetCopyFileFinishedHandler
U _BOMCopierSetCopyFileStartedHandler
U _BOMCopierSetCopyFileUpdateHandler
U _BOMCopierSetFatalErrorHandler
U _BOMCopierSetFatalFileErrorHandler
#!/usr/bin/perl
=com
PURPOSE
This script will
Force you through a comprehensive quality-control checklist
Run Deploymate
Get the latest version number by reading it from product's Info.plist
@ppeszko
ppeszko / React Native: Animated - Code
Created April 24, 2016 13:59 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
<br /><br />
# React Native: Animated
ReactEurope 2015, Paris - Spencer Ahrens - Facebook
<br /><br />
## Fluid Interactions
- People expect smooth, delightful experiences
import UIKit
struct Payment { }
enum PaymentResponse {
case Accepted(Payment)
case Rejected(Payment)
}
// It's just an example for notifications. The rest can be safely ignored :)
// It's just an example for notifications. The rest can be safely ignored :)
class HappyPaymentViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
PaymentNotifications.accepted.observe(self,
selector: #selector(HappyPaymentViewController.paymentNotificationReceived(_:)))
PaymentNotifications.rejected.observe(self,
selector: #selector(HappyPaymentViewController.paymentNotificationReceived(_:)))