Skip to content

Instantly share code, notes, and snippets.

{
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_size": 12.0,
"highlight_line": true,
"enable_tab_scrolling": false,
"ignored_packages":
[
"Vintage"
],
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
const foregroundColor = '#f0f8f2';
const backgroundColor = '#272822';
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
@tomasdev
tomasdev / app.js
Created March 6, 2013 05:51
Ember Handlebars external templates
// Taken from http://stackoverflow.com/questions/10274391/is-it-possible-to-load-handlebar-template-with-script-tag-or-define-handlebar-t/13474886#13474886
Ember.View.reopen({
templateForName: function(name, type) {
if (!name) { return; }
var templates = Ember.get(this, 'templates'),
template = Ember.get(templates, name);
if (!template) {
$.ajax({
@tomasdev
tomasdev / uuid-v4.js
Last active February 26, 2018 04:50
JavaScript UUID Generation using RFC4122 v4 (Random)
// UPDATE: shorter, non RFC compatible, but safe enough version
function guid() {
const s4 = () => Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
}
// Based off https://github.com/kelektiv/node-uuid
@tomasdev
tomasdev / mp4-to-gif.sh
Created February 9, 2018 17:11
MP4 to GIF using FFMPEG
# Step 1: define video
export VIDEO=name.mp4
# Step 2: create palette to have a better image quality result
ffmpeg -i $VIDEO -vf fps=15,scale=320:-1:flags=lanczos,palettegen palette.png
# Step 3: use the palette to convert the mp4 to gif
ffmpeg -i $VIDEO -i palette.png -filter_complex "fps=15,scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse" $VIDEO.gif
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
{
"bold_folder_labels": true,
"font_size": 12.0,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"tab_size": 4,
"theme": "Soda Dark.sublime-theme",
@tomasdev
tomasdev / levenshtein.js
Created February 29, 2012 00:48
Levenshtein JavaScript
var levenshtein = function(str1, str2) {
str1 = str1.split("");
str2 = str2.split("");
var distance = [],
l = str1.length,
m = str2.length,
i, j;
for( i = 0; i <= l; i++ ) {
@tomasdev
tomasdev / gist:b526c5ddfa06a417297012d6a46b36b0
Last active October 27, 2017 18:11
https://files.fm/u/u7x6q9t7 IS A VIRUS wp-gif-player download link

BEWARE https://files.fm/u/u7x6q9t7 THIS IS A VIRUS FOR WORDPRESS. DO NOT INSTALL IT ON YOUR WEBSITE.

A chinese person (in our contact case was AMELIA SMITH (amelia.smith12@outlook.com) is sending emails from outlook dot com saying they'd pay $50 to $100 per month if you install that. It has a backdoor that lets people upload and delete files from your server.

It is not the plugin https://github.com/sketchmouse/wp-gif-player that @dbedenknecht created, since that one (original) doesn't have the sneaky file in question, wp-inc.php

This "Amelia" is claiming to "verify" the plugin is installed in other sites by mentioning a different file, part of the original plugin.

Again, always check with a programmer before manually installing plugins into WordPress that aren't from wp.com

// This file is overwritten whenever you change your user settings in the game.
// Add custom configurations to the file "userconfig.cfg".
unbindall
bind "TAB" "+showscores"
bind "ENTER" "+attack"
bind "ESCAPE" "cancelselect"
bind "SPACE" "+jump"
bind "'" "+moveup"
bind "+" "sizeup"