Skip to content

Instantly share code, notes, and snippets.

@bsalex
bsalex / gist:e22c0e66da0f20214366
Created July 23, 2014 20:45
Console command to renames all files and subdirectories replaceing spaces with "_" in their names
find . -name "*\ *" -type f -exec sh -c 'mv "{}" "`echo \"{}\" | sed \"s/ /_/g\"`"' \; && find . -depth -name "*\ *" -type d -execdir sh -c 'mv "{}" "`echo "{}" | sed "s/ /_/g"`"' \;
var React = require('react/addons')
var Button = React.createClass({
getInitialState: function() {
return {active:false}
},
click: function() {
this.setState({active: !this.state.active})
},
render: function() {
Remote Address:91.217.66.14:8180
Request URL:http://cn.infopulse.com.ua:8180/mobile/upload/?linkcode=c74f271b-d0d9-4d97-a613-a28a33294c78
Request Method:POST
Status Code:500 Internal Server Error
Request Headersview source
Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8,de;q=0.6,ru;q=0.4,uk;q=0.2
Cache-Control:no-cache
Connection:keep-alive
<html><head><title>Apache Tomcat/7.0.42 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOnly</h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction
Fix to iOS iframe height issue
<iframe id="stupid-iframe" height="200" src="a-file.html"></iframe>
<html>
<body>
<div class="iframe-wrapper" style="width: 100%; height: 200px; overflow: auto; -webkit-overflow-scrolling: touch;">
</div>
</body>
@bsalex
bsalex / states.rb
Last active August 27, 2015 09:41 — forked from dblandin/states.rb
Ruby array of US state name and abbreviations
states = Array[ ["AK", "Alaska"],
["AL", "Alabama"],
["AR", "Arkansas"],
["AS", "American Samoa"],
["AZ", "Arizona"],
["CA", "California"],
["CO", "Colorado"],
["CT", "Connecticut"],
["DC", "District of Columbia"],
["DE", "Delaware"],
@bsalex
bsalex / .babelrc
Created October 30, 2015 19:14 — forked from joshq00/.babelrc
Babel 6 : React / stage 0
{
"presets": [ "react", "es2015" ],
"plugins": [
"transform-es2015-modules-commonjs",
"transform-react-constant-elements"
]
}
@bsalex
bsalex / index.js
Last active December 14, 2015 00:43
Creates/Overrides object prop based on existing object props
R.converge(
R.assoc('x'),
[
R.compose(
R.inc, R.prop('y')
),
R.identity
]
)({x:1, y:4})
@bsalex
bsalex / .fonts.conf
Created March 19, 2016 21:12 — forked from dcrystalj/.fonts.conf
Updated version of the fonts.conf file mentioned in http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux/ in order to get rid of most of the fontconfig warnings (mostly the "Having multiple values in <test> isn't supported and may not work as expected")
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@bsalex
bsalex / dabblet.css
Last active August 12, 2016 08:44
Untitled
.outer {
width: 500px;
height: 500px;
background-color: #88CCFF;
}
.limited {
width: 200px;
min-height: 50%;
max-height: 70%;