Collection of JS tips and tricks
This file contains 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
import java.io.File; | |
import java.io.RandomAccessFile; | |
public class MyFileReader { | |
public static void main(String[] args) throws Exception { | |
File file = new File("bigfile.txt"); | |
RandomAccessFile raf = new RandomAccessFile(file, "r"); | |
long maxSize = 500000; | |
if(file.exists()){ | |
long size = file.length(); |
This file contains 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
<script> | |
export default { | |
mounted(){ | |
this.alasql("CREATE TABLE cities (city string, population number)"); | |
this.alasql("INSERT INTO cities VALUES ('Rome',2863223),('Paris',2249975),('Berlin',3517424),('Madrid',3041579)"); | |
var res = this.alasql("SELECT * FROM cities WHERE population < 3500000 ORDER BY population DESC"); | |
console.log(res); | |
} | |
} | |
</script> |
This file contains 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
Allophane | |
Amethyst | |
Apophyllite | |
aquamarine | |
Arsenopyrite | |
Chihuahua | |
Aurichalcite | |
Austinite | |
Mapimí | |
Durango |
This file contains 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
using System; | |
using System.Collections.Generic; | |
// Need to link Microsoft.CSharp in reference | |
namespace MyPlayground { | |
class MainClass { | |
public static void Main(string[] args) { | |
var list = new List<dynamic>(); | |
list.Add(new { | |
Text = "hello", | |
Value = "world" |
- Click Username
- Click Configuration
- Show API Token Button
curl -g http://myusername:[email protected]:8080/api/json?pretty=true
This file contains 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
[Route("Upload/")] | |
[HttpPost] | |
public async Task<object> Upload(string fileName){ | |
string path = Path.GetTempPath(); | |
var provider = new MultipartFormDataStreamProvider(path); | |
await Request.Content.ReadAsMultipartAsync(provider); | |
var tmpFilePath = provider.FileData.Select(entry => entry.LocalFileName).First(); | |
var targetFilePath = Path.Combine(@"C:\tmp\", fileName); | |
File.Copy(tmpFilePath,targetFilePath); | |
return fileName + " has been saved on " + targetFilePath + " via " + tmpFilePath; |
This file contains 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
import UIKit | |
import CoreLocation | |
class FirstViewController: UIViewController, CLLocationManagerDelegate { | |
var locationManager:CLLocationManager = CLLocationManager() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
locationManager.requestAlwaysAuthorization() | |
locationManager.delegate = self | |
let region:CLBeaconRegion = CLBeaconRegion(proximityUUID: UUID(uuidString:"2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6")!, identifier: "kiichi.test") |
This file contains 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
import { Component } from '@angular/core'; | |
import { NavController } from 'ionic-angular'; | |
import { IBeacon } from '@ionic-native/ibeacon'; | |
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' | |
}) | |
export class HomePage { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.