This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #taken from: http://askubuntu.com/questions/87061/can-i-make-tab-auto-completion-case-insensitive-in-the-terminal | |
| # If ~./inputrc doesn't exist yet, first include the original /etc/inputrc so we don't override it | |
| if [ ! -a ~/.inputrc ]; then echo "\$include /etc/inputrc" > ~/.inputrc; fi | |
| # Add option to ~/.inputrc to enable case-insensitive tab completion | |
| echo "set completion-ignore-case On" >> ~/.inputrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This program is free software. It comes without any warranty, to | |
| * the extent permitted by applicable law. You can redistribute it | |
| * and/or modify it under the terms of the Do What The Fuck You Want | |
| * To Public License, Version 2, as published by Sam Hocevar. See | |
| * http://www.wtfpl.net/ for more details. | |
| */ | |
| public static void openWebpage(String url, String... browsers) throws IOException { | |
| String os = System.getProperty("os.name").toLowerCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This program is free software. It comes without any warranty, to | |
| * the extent permitted by applicable law. You can redistribute it | |
| * and/or modify it under the terms of the Do What The Fuck You Want | |
| * To Public License, Version 2, as published by Sam Hocevar. See | |
| * http://www.wtfpl.net/ for more details. | |
| */ | |
| // import Object | |
| var object = require("./object.js"); | |
| //init object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This program is free software. It comes without any warranty, to | |
| * the extent permitted by applicable law. You can redistribute it | |
| * and/or modify it under the terms of the Do What The Fuck You Want | |
| * To Public License, Version 2, as published by Sam Hocevar. See | |
| * http://www.wtfpl.net/ for more details. | |
| */ | |
| public static double getProcessCpuLoad() throws MalformedObjectNameException, ReflectionException, InstanceNotFoundException { | |
| MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This program is free software. It comes without any warranty, to | |
| # the extent permitted by applicable law. You can redistribute it | |
| # and/or modify it under the terms of the Do What The Fuck You Want | |
| # To Public License, Version 2, as published by Sam Hocevar. See | |
| # http://www.wtfpl.net/ for more details. | |
| Foobars.objects.filter(**{'bar__icontains': 'foo'}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This program is free software. It comes without any warranty, to | |
| * the extent permitted by applicable law. You can redistribute it | |
| * and/or modify it under the terms of the Do What The Fuck You Want | |
| * To Public License, Version 2, as published by Sam Hocevar. See | |
| * http://www.wtfpl.net/ for more details. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This program is free software. It comes without any warranty, to | |
| # the extent permitted by applicable law. You can redistribute it | |
| # and/or modify it under the terms of the Do What The Fuck You Want | |
| # To Public License, Version 2, as published by Sam Hocevar. See | |
| # http://www.wtfpl.net/ for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This program is free software. It comes without any warranty, to | |
| # the extent permitted by applicable law. You can redistribute it | |
| # and/or modify it under the terms of the Do What The Fuck You Want | |
| # To Public License, Version 2, as published by Sam Hocevar. See | |
| # http://www.wtfpl.net/ for more details. | |
| #some constants |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This program is free software. It comes without any warranty, to | |
| # the extent permitted by applicable law. You can redistribute it | |
| # and/or modify it under the terms of the Do What The Fuck You Want | |
| # To Public License, Version 2, as published by Sam Hocevar. See | |
| # http://www.wtfpl.net/ for more details. | |
| # raise the window which has the string "Atom" in its title but is not chrome and switch to its workspace | |
| wmctrl -ai $(wmctrl -l | grep Atom | grep -iv chrome | cut -b-10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Example taken from http://www.mkyong.com/java/how-to-send-http-request-getpost-in-java/ | |
| * | |
| **/ | |
| private static void sendPost() throws Exception { | |
| String url = "https://www.sampleURL.example"; | |
| URL obj = new URL(url); | |
| HttpsURLConnection con = (HttpsURLConnection) obj.openConnection(); |