What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-07 23:56:04
download audio file javascript
var filename = url.substring(url.lastIndexOf("/") + 1).split("?")[0]; var xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr.onload = function() { var a = document.createElement('a'); a.href = window.URL.createObj... Add solution -
C# 2021-10-07 17:01:03
c# .equals vs ==
string s1 = "test"; string s2 = "test"; string s3 = "test1".Substring(0, 4); object s4 = s3; Console.WriteLine($"{object.ReferenceEquals(s1, s2)} {s1 == s2} {s1.Equals(s2)}"); Console.WriteLine($"{object.Refer... Add solution -
Other 2021-10-07 11:43:05
input formatting
1/* Test Formatting Input (TestFormattedInput.cpp) */ #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { string areaCode, phoneCode; string inStr; cout << "Enter your phone ... Add solution -
Javascript 2021-10-07 08:17:02
javascript extract json from string
function extractJSON(str) { var firstOpen, firstClose, candidate; firstOpen = str.indexOf('{', firstOpen + 1); do { firstClose = str.lastIndexOf('}'); console.log('firstOpen: ' + firstOpen, 'firstClose: ' + firstClose); ... Add solution -
Javascript 2021-10-07 02:51:05
javascript detect mobile or desktop
// Excluding tablets window.mobileCheck = function() { let check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|... Add solution -
Javascript 2021-10-06 22:03:05
javascript insert text in textarea at cursor position
function insertAtCaret(areaId, text) { var txtarea = document.getElementById(areaId); var strPos = 0; var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? "ff" : (document.selection ? "ie" : false)); ... Add solution -
C# 2021-10-06 20:15:06
c# get process owner
//----------------------------------------- // Very fast non-WMI process username search // import System.Security.Principal // and System.Runtime.InteropServices // for this to work //----------------------------------------- private static string GetP... Add solution -
Javascript 2021-10-06 18:28:04
js save and load an array of different types into localstorage
var myArray = [1,"word",23,-12,"string"];//your list of values, they can be strings or numbers //SAVING function save(a,b,c,d,e) {//the number of parameters you add is how many items you save var itemArray = [a,b,c,d,e];//number of... Add solution -
Java 2021-10-06 05:10:02
string frequency of characters in java
+++METHOD WITH NONDUP+++ public static String FrequencyOfChars(String str) { String nonDup = ""; for(int i=0; i < str.length(); i++) if(!nonDup.contains(""+str.charAt(i))) nonDup+= ""+str.charAt(i); String expectedRe... Add solution
Best helpers
Ranking is empty