Skip to content

Instantly share code, notes, and snippets.

View heartcode's full-sized avatar

Robert Pataki heartcode

View GitHub Profile
.scenes-wrapper {
background-color: red;
@include perspective(100000000px);
// @include perspective-origin(50% 50%);
margin: 0 auto;
width: 100%;
height: 100%;
}
.scenes {
position: relative;
@heartcode
heartcode / snippets.js
Last active December 26, 2015 12:59
Useful set of JavaScript snippets
// Replace extra spaces with single ones and get rid of any spaces at the end and beginning of the string.
// http://stackoverflow.com/questions/6163169/replace-multiple-whitespaces-with-single-whitespace-in-javascript-string - Marku Uttula's answer
var s = " too much trailing space "
s = s.replace(/^(\s*)|(\s*)$/g, '').replace(/\s+/g, ' ');
// Determining the base font size, so that we can use em and rem units in JS
// TODO - make it foolproof and compatible with browsers, which handle `getComputedStyle()`
function getDefaultFontSize() {
var el = document.body.appendChild(document.createElement('p'));
el.innerHTML = 'size matters';
@heartcode
heartcode / jenkinz.log
Created October 17, 2013 13:43
Jenkinz app crashes, this is the console log output
14/10/2013 16:28:54.220 Evernote: -[EDAMSyncState read:]: unexpected field ID 5 with type 10. Skipping.
14/10/2013 16:28:54.535 Evernote: -[EDAMSyncState read:]: unexpected field ID 5 with type 10. Skipping.
14/10/2013 16:30:06.240 applepushserviced: <APSCourier: 0x7fe1c200eca0>: Stream error occurred for <APSTCPStream: 0x7fe1c26005f0>: The operation couldn’t be completed. Connection reset by peer
14/10/2013 16:32:07.707 applepushserviced: <APSCourier: 0x7fe1c200eca0>: Stream error occurred for <APSTCPStream: 0x7fe1c26005f0>: The operation couldn’t be completed. Connection reset by peer
14/10/2013 16:34:09.175 applepushserviced: <APSCourier: 0x7fe1c200eca0>: Stream error occurred for <APSTCPStream: 0x7fe1c26005f0>: The operation couldn’t be completed. Connection reset by peer
14/10/2013 16:36:12.655 applepushserviced: <APSCourier: 0x7fe1c200eca0>: Stream error occurred for <APSTCPStream: 0x7fe1c26005f0>: The operation couldn’t be completed. Connection reset by peer
14/10/2013 16:38:16.135 applepushserviced:
@heartcode
heartcode / Base File.sublime-settings
Created September 5, 2013 11:38
DocBlockr (sublime-jsdoc) user settings
{
// If set to true, primitives such as "Number" and "String" will be documented as "number" and "string".
"jsdocs_lower_case_primitives": false,
// indicates whether the @method tag should be added automatically
"jsdocs_autoadd_method_tag": true,
// Any additional boilerplate tags which should be added to each block. Should be an array of strings.
// Note that this only applies when a docblock is opened directly preceding a function.
// Tab points can be added by using snippet syntax, eg: ${1:default text}
"jsdocs_extra_tags": ["@protected"]
}
@heartcode
heartcode / gist:6150225
Created August 4, 2013 12:45
My Sublime Text User Prefs
{
"color_scheme": "Packages/Theme - Default/Tomorrow-Night-Eighties.tmTheme",
"folder_exclude_patterns":
[
"build",
"docs",
".*",
"acceptance-test/src",
"acceptance-test/deps",
"acceptance-test/target",
@heartcode
heartcode / .gitconfig
Last active December 20, 2015 09:49
.gitconfig
# More great options: http://thomashunter.name/blog/git-colored-output-shortcut-commands-autocompletion-and-bash-prompt/
[color]
diff = auto
status = auto
branch = auto
[format]
pretty = "Commit: %C(yellow)%H%nAuthor: %C(green)%aN <%aE>%nDate: (%C(red)%ar%Creset) %ai%nSubject: %s%n%n%b"
@heartcode
heartcode / .bash_profile
Last active December 19, 2015 15:09
.bash_profile v2
export PATH="/bin:/sbin:/usr/local/etc:/usr/local/mysql/bin:/usr/bin:usr/local/sbin:/usr/local/bin:$PATH/.rbenv/bin:$HOME"
eval "$(rbenv init - --no-rehash)"
# Load SSH keys
ssh-add
[[ -s ~/.bashrc ]] && source ~/.bashrc
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
@heartcode
heartcode / mixins.css.scss
Created November 9, 2012 11:09
SASS mixins
@mixin background_image ($filename) {
background-image: image-url(1x/#{$filename});
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
background-image: image-url(2x/#{$filename});
}
}
@heartcode
heartcode / mixins.css.scss
Created October 26, 2012 15:39
CSS animation mixin
@mixin animation ($transform: background, $duration: 0.3s, $easing: ease, $delay: 0.3s) {
-webkit-transition: $transform $duration $easing $delay;
-moz-transition: $transform $duration $easing $delay;
-o-transition: $transform $duration $easing $delay;
transition: $transform $duration $easing $delay;
}
@heartcode
heartcode / .bash_profile
Last active October 10, 2015 15:47
.bash_profile
export PATH="/usr/local/bin:/usr/local/mysql/bin:/usr/local/etc:/usr/local/sbin:$PATH"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
# [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
source ~/.git-completion.sh
ssh-add
function rvm_version {
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}')