Skip to content

Instantly share code, notes, and snippets.

/*Does not work as is just the basic idea*/
var fs; //chrome.syncFileSystem.requestFileSystem();
var reader = new FileReader();
var file,data;
fs.root.getFile("somefile.txt",{},function(a){file = a;});
reader.onloadend = function(){data=this.result;};
file.file(function(f){reader.readAsText(f);});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//2d Vector class (based on Vector.js)
var Vector = function(x,y){ this.x = x || 0; this.y = y || 0; };
Vector.prototype={
rot: function(a) {
var theta = a * Math.PI/180,
cs = Math.cos(theta),
sn = Math.sin(theta),
px = this.x * cs - this.y * sn;
py = this.x * sn + this.y * cs;
this.x = px;
@Deftwun
Deftwun / wordpress-change-domain-migration.sql
Created November 11, 2016 04:52 — forked from chuckreynolds/wordpress-change-domain-migration.sql
Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. __STEP3: make sure your databa…
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
@Deftwun
Deftwun / EncodingTest.txt
Created March 24, 2022 16:50
Testing - Emoji text file
This is a file with emojis & ascii chars
🔗
☘️
¢
£
®