Skip to content

Instantly share code, notes, and snippets.

View virusvn's full-sized avatar

Nhan Nguyen virusvn

View GitHub Profile
# 新語辞書 mecab-ipadic-neologd の追加(2回目以降は) 辞書更新
./bin/install-mecab-ipadic-neologd -n -a
@aedm
aedm / meteordeps.js
Last active January 5, 2018 07:33
This script displays dependency relations between packages required by a Meteor project
"use strict";
const execSync = require('child_process').execSync;
const fs = require('fs');
function run(command) {
return execSync(command).toString().trim();
}
console.log("Reading 'versions' file...");
@delfrrr
delfrrr / background.js
Created January 31, 2017 08:34
react-native requestAnimationFrame and d3-interpolate
//this is an example of background animation from my weather comparsion app
//you can get early build of app at http://zowni.com
//full source of background.js below
const React = require('react');
const Svg = React.createFactory(require('react-native-svg').Svg);
const {interpolate} = require('d3-interpolate');
//...
/**
@anttiviljami
anttiviljami / wp-admin-modal-dialog.php
Last active January 5, 2024 14:25
WordPress admin modal dialog example
<?php
// enqueue these scripts and styles before admin_head
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though...
wp_enqueue_style( 'wp-jquery-ui-dialog' );
?>
<!-- The modal / dialog box, hidden somewhere near the footer -->
<div id="my-dialog" class="hidden" style="max-width:800px">
<h3>Dialog content</h3>
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p>
import React from 'react-native'
var {
Image,
Animated,
View
} = React
module.exports = React.createClass({
getInitialState() {
// p = require('./extract_meteor_deps');
// Package = p.Package;
// getPackageDeps = p.getPackageDeps; depsByPackage = p.depsByPackage;
//
// > getPackageDeps('spacebars')
// ['htmljs', 'blaze', 'observe-sequence', 'templating']
// > depsByPackage
// {"spacebars": ['htmljs', 'blaze', 'observe-sequence', 'templating']}
var Package, api, depsByPackage, getPackageDeps, mockApiUse, _;
@koistya
koistya / React-Directory-Layout.md
Last active April 7, 2024 19:01
File and folder naming convention for React.js components

File and folder naming convention for React.js components

Directory Layout #1

/actions/...
/components/common/Link.js
/components/common/...
/components/forms/TextBox.js
/components/forms/TextBox.res/style.css
@brandonsimpson
brandonsimpson / osx_uninstall_mysql_install_mariadb_homebrew.md
Last active August 19, 2023 22:55
OSX How To: Uninstall native MySQL and install MariaDB via Homebrew

OSX How To: Uninstall native MySQL and install MariaDB via Homebrew

This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well, especially if you're used to managing MySQL installs via yum in linux.

First: Backup Your Data!

Backup all of your current databases with mysqldump

This isn't a tutorial on backups, and there are many ways to do it. You should know how to backup your data anyway. For this example, we'll do a full backup of our InnoDB databases.

@royriojas
royriojas / why-I-love-Javascript.md
Last active September 30, 2020 13:58
Why I love Javascript

Why I love Javascript

  1. Because it has a humble origin... Designed in 10 days... was proclaimed death several times, and it was planned to be replaced by many other more "powerful" languages

  2. Because it has closures and lambdas, and the prototypal inheritance (the good parts)

  3. Because it is weird, in a very nice sense... (some bad parts... maybe?)

From the video WAT (https://www.destroyallsoftware.com/talks/wat)

@possibilities
possibilities / meteor-async.md
Created August 23, 2012 22:53
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase: