Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Github introduced status feature. Twitter is in danger

autumnharmony

:octocat:
Github introduced status feature. Twitter is in danger
View GitHub Profile
@autumnharmony
autumnharmony / ps4-shutdown
Last active May 8, 2020
ps4 remote shutdown
View ps4-shutdown
dependencies:
https://www.npmjs.com/package/ps4-waker
jq
View tiles-mock
var fs = require('fs'),
gm = require('gm').subClass({
imageMagick: true
});
module.exports = MockBase => class MockRivers extends MockBase {
mocks(options) {
return [{
route: '/tiles/:z/:x\::y/tile.png',
View gist:a58d5a213620d4854cf862ee13b38a99
svn import -m "Adding just a file" file_name http://path/to/svn/repo/file_name
@autumnharmony
autumnharmony / pain
Created Nov 23, 2013
Дорефакторился
View pain
org.apache.myfaces.view.facelets.el.ContextAwareELException: javax.el.ELException: <openjpa-2.2.0-r422266:1244990 fatal user error> org.apache.openjpa.persistence.ArgumentException: Errors encountered while resolving metadata. See nested exceptions for details.
at org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpression.invoke(ContextAwareTagMethodExpression.java:108)
at org.apache.myfaces.view.facelets.tag.jsf.core.EventHandler$Listener.processEvent(EventHandler.java:280)
at javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:1565)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
at org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2410)
at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:577)
at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:330)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:580)
at jav
View OOGraph.java
aShapeProp.setPropertyValue("CLSID", "47BBB4CB-CE4C-4E80-A591-42D9AE74950F")
View XMLTransform.java
import org.apache.xalan.processor.TransformerFactoryImpl;
import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
import org.jdom2.transform.JDOMResult;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@autumnharmony
autumnharmony / gist:4171172
Created Nov 29, 2012
Indexes of all occurrences of character in a string
View gist:4171172
for (int index = word.indexOf(guess);
index >= 0;
index = word.indexOf(guess, index + 1))
{
System.out.println(index);
}
@autumnharmony
autumnharmony / gist:4143296
Created Nov 25, 2012
split number and not numbers
View gist:4143296
expressionString.split("(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)");
@autumnharmony
autumnharmony / gist:1239254
Created Sep 24, 2011
Exceptions in C with Longjmp and Setjmp
View gist:1239254
#include <stdio.h>
#include <setjmp.h>
#define TRY do{ jmp_buf ex_buf__; if( !setjmp(ex_buf__) ){
#define CATCH } else {
#define ETRY } }while(0)
#define THROW longjmp(ex_buf__, 1)
int
main(int argc, char** argv)