Skip to content

Instantly share code, notes, and snippets.

View autumnharmony's full-sized 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 November 7, 2024 15:29
ps4 remote shutdown
dependencies:
https://www.npmjs.com/package/ps4-waker
jq
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',
@autumnharmony
autumnharmony / gist:a58d5a213620d4854cf862ee13b38a99
Created May 12, 2017 07:29
svn add file without checking out
svn import -m "Adding just a file" file_name http://path/to/svn/repo/file_name
wget -r -np -l1 -H -t1 -nd -N -erobots=off
@autumnharmony
autumnharmony / pain
Created November 23, 2013 18:20
Дорефакторился
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
aShapeProp.setPropertyValue("CLSID", "47BBB4CB-CE4C-4E80-A591-42D9AE74950F")
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 November 29, 2012 19:08
Indexes of all occurrences of character in a string
for (int index = word.indexOf(guess);
index >= 0;
index = word.indexOf(guess, index + 1))
{
System.out.println(index);
}
@autumnharmony
autumnharmony / gist:4143296
Created November 25, 2012 12:20
split number and not numbers
expressionString.split("(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)");
@autumnharmony
autumnharmony / gist:1239254
Created September 24, 2011 12:08
Exceptions in C with Longjmp and Setjmp
#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)