Skip to content

Instantly share code, notes, and snippets.

Joseph Rawson umeboshi2

Block or report user

Report or block umeboshi2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jcubic
jcubic / compile
Last active Jan 19, 2020
POC for Emscripten Async code + jQuery Terminal
View compile
emcc -o main.html -s FETCH=1 -s NO_EXIT_RUNTIME=0 main.c
@ErikAugust
ErikAugust / spectre.c
Last active Jan 23, 2020
Spectre example code
View spectre.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@Sohojoe
Sohojoe / continuous_trainer.py
Last active Dec 15, 2019
OpenAi.Gym.Baselines.DeepQ Restoring checkpoint in next training
View continuous_trainer.py
import os
import subprocess
import threading
import sys
from signal import *
cur_path = os.path.dirname(os.path.realpath(__file__))
@crmne
crmne / download_zeal_user_docsets.py
Last active Oct 17, 2018
A solution to the lack of UI for Dash's user docsets in Zeal. Uses Python 3 and easygui (pip3 install easygui)
View download_zeal_user_docsets.py
import os
import json
import tarfile
import urllib.request
import easygui
import configparser
user_docsets_url = 'https://dashes-to-dashes.herokuapp.com/docsets/contrib'
app_title = 'Download Zeal user docsets'
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active Nov 30, 2019
Moving to ES6 from CoffeeScript
View gist:0b60c2ed1f069f118562

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

View defrag-btrfs.sh
#!/bin/bash
#
# Search $1 path (default to /) for files with over $2 (defaults to 100) fragments and attempts to defragment them.
#
# Author: Kyle Manna
#
root=${1:-/}
min=${2:-100}
@tbonza2
tbonza2 / gist:20757551443a61254aa6
Last active Nov 4, 2016
Saltstack mode for emacs
View gist:20757551443a61254aa6

Saltstack mode for emacs

Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the question on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text implementation appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

Reasoning

After looking around, I found that someone had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use Mako templates for a project not involving Saltstack. Since Edx uses Mako t

@BinaryMuse
BinaryMuse / README.md
Last active Feb 1, 2017
Integrating React with Marionette
View README.md

Integrating React with Marionette

See ReactComponentView and BackboneModelWatchMixin, below.

Notes

The BackboneModelWatchView could use some additional methods to allow adding/removing watched models after the component is created.

@adilapapaya
adilapapaya / README
Last active Jan 22, 2020
Export Table Data to CSV using Javascript
View README
Example code for exporting data in a table to a csv file.
@leoasis
leoasis / marionette_rivets.js
Last active Mar 7, 2019
React vs Marionette + Rivets
View marionette_rivets.js
var List = Backbone.Marionette.CollectionView.extend({
itemView: Item,
tagName: 'ul'
});
var Item = Backbone.Marionette.ItemView.extend({
tagName: 'li',
template: function(data) {
return '<span rv-text="model.name"></span><p rv-text="model.description"><p>';
},
You can’t perform that action at this time.