Skip to content

Instantly share code, notes, and snippets.

View acao's full-sized avatar
🇺🇦

Rikki Schulte acao

🇺🇦
View GitHub Profile
@acao
acao / index.html
Last active October 28, 2017 18:41
Get/Set Benchmark Step 2
<script>
var suite = new Benchmark.Suite();
const obj = {
stuff: {
things: {
stuff: 'things',
things: 'stuff',
other: {
stuff: 'things'
}
@acao
acao / index.html
Created October 28, 2017 18:35
Get/Set Benchmark Step 1
<!doctype html>
<html>
<head>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/mariocasciaro/object-path/master/index.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/2.1.4/benchmark.min.js"></script>
<h1>Hello</h1>
<script>
@acao
acao / benchmark.html
Last active October 28, 2017 18:31
Benchmark lodash get/set, object-path get/set, and a cheap vanilla get/set
<!doctype html>
<html>
<head>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/mariocasciaro/object-path/master/index.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/platform/1.3.4/platform.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/2.1.4/benchmark.min.js"></script>
<h1>Hello</h1>
@acao
acao / api.js
Last active August 4, 2017 05:49
import urllib.request
import json
mapApiUrl = "https://maps.googleapis.com/maps/api/distancematrix/json"
class Tour:
def __init__(self,city, *cities):
self.cities = cities
self.destinations = ';'.join(cities)
self.originCity = city
@acao
acao / index.js
Last active January 4, 2016 21:53
Minimal electron main process
/* eslint strict: 0 */
'use strict';
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
let mainWindow = null;
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
@acao
acao / webpack.config.js
Last active January 4, 2016 22:01
A minimal webpack config for electron
/* eslint strict: 0 */
'use strict';
const path = require('path');
const webpack = require('webpack');
const webpackTargetElectronRenderer = require('webpack-target-electron-renderer');
let options ={
module: {
loaders: [{
@acao
acao / webpack.config.js
Last active January 12, 2022 17:30
Webpack example for electron and web
/* eslint strict: 0 */
'use strict';
const path = require('path');
const webpack = require('webpack');
const webpackTargetElectronRenderer = require('webpack-target-electron-renderer');
var argv = require('minimist')(process.argv.slice(2));
const isWeb = (argv && argv.target === 'web');
const output = (isWeb ? 'build/web' : 'build/electron');
<pre style="display:inline-block;text-align:center;font-family:monospace;letter-spacing:6.5px;line-height:13px;font-size:13px;font-weight:bold;">
<span style="color:rgb(127, 127, 127);">C</span><span style="color:rgb(236, 236, 236);">a</span><span style="color:rgb(254, 254, 254);">n</span><span style="color:rgb(254, 254, 254);">'</span><span style="color:rgb(254, 254, 254);">t</span><span style="color:rgb(255, 255, 255);">&nbsp;</span><span style="color:rgb(254, 254, 254);">f</span><span style="color:rgb(254, 254, 254);">u</span><span style="color:rgb(254, 254, 254);">c</span><span style="color:rgb(254, 254, 254);">k</span><span style="color:rgb(254, 254, 254);">&nbsp;</span><span style="color:rgb(254, 254, 254);">w</span><span style="color:rgb(254, 254, 254);">i</span><span style="color:rgb(254, 254, 254);">t</span><span style="color:rgb(254, 254, 254);">h</span><span style="color:rgb(255, 255, 255);">&nbsp;</span><span style="color:rgb(254, 254, 254);">t</span><span style="color:rgb(254, 254, 254);">h</span
@acao
acao / queueexample.php
Created September 12, 2014 21:53
Queue Example
<?php
/**
* Implements hook_drush_command()
* goes in modulename.drush.inc
*/
function yogatrail_schedules_drush_command() {
$items = array();
$items['yt-schedules-update-classes'] = array();
<?php
function example_update_N(){
// This manually enables the module using the same function features will use in the other example
features_module_enable('backup_migrate');
// Now you don't need to revert dependencies component because you've already enabled the module that you added.
$features['site_config'] = array('variable');
$features_rebuild($features);
$features_revert($features);