Skip to content

Instantly share code, notes, and snippets.

@jappy
jappy / gist:2038841
Created March 14, 2012 19:25
unix command recursive sed like search and replace that works on mac os x
# searches from ./
find . -type f|xargs perl -pi -e 's/\t/ /g'
@blargg
blargg / LocalStorage.hs
Last active March 17, 2018 09:18
Using javascript function with Reflex and JSaddle
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
import Reflex.Dom
import Control.Monad.IO.Class
import Control.Monad (void)
import Data.Text (Text)
import Language.Javascript.JSaddle
import Control.Lens ((^.))
main :: IO ()
@priyadarshan
priyadarshan / sockets.txt
Created February 23, 2017 12:36
Common lisp sockets
Source: http://www.huuii.com/people/juan/1301
I want to use sockets under common lisp, so I am going to create a two simple functions the first one serve-socket and the second client-socket, I am going to use usocket library.
- Load the library:
(ql:quickload "usocket")
- Change to usocket library
(in-package :usocket)
# This file is useful for reading the contents of the ops generated by ruby.
# You can read any graph defination in pb/pbtxt format generated by ruby
# or by python and then convert it back and forth from human readable to binary format.
import tensorflow as tf
from google.protobuf import text_format
from tensorflow.python.platform import gfile
def pbtxt_to_graphdef(filename):
with open(filename, 'r') as f:
@html
html / cyr-to-lat-russian-transliteration.lisp
Created November 3, 2012 12:08
Transliteration from Cyrillic to Latin in Common Lisp of Russian symbols/Транслитерация с кирилицы в латиницу на Common Lisp русских символов
(defun transliterate-cyr-to-lat-russian (text)
; Taken from http://cl-cookbook.sourceforge.net/strings.html
(defun replace-all (string part replacement &key (test #'char=))
"Returns a new string in which all the occurences of the part
is replaced with replacement."
(with-output-to-string (out)
(loop with part-length = (length part)
for old-pos = 0 then (+ pos part-length)
for pos = (search part string
:start2 old-pos
@eerwitt
eerwitt / load_jpeg_with_tensorflow.py
Created January 31, 2016 05:52
Example loading multiple JPEG files with TensorFlow and make them available as Tensors with the shape [[R, G, B], ... ].
# Typical setup to include TensorFlow.
import tensorflow as tf
# Make a queue of file names including all the JPEG images files in the relative
# image directory.
filename_queue = tf.train.string_input_producer(
tf.train.match_filenames_once("./images/*.jpg"))
# Read an entire image file which is required since they're JPEGs, if the images
# are too large they could be split in advance to smaller files or use the Fixed

Connecting separate DDEV containers for migration

Using some of the information from this article, and information from a few other sources, I have come up with a procedure for connecting two separate local DDEV containers for Drupal 7 to Drupal 9 migration work.

  1. Create your Drupal 7 container from the source. In this case, we will be using a Pantheon-based website.
  2. Create your new Webspark 2 (Drupal 9) site in Pantheon.
  3. Install and enable modules in the new D9 site. (If you want to migrate content from D7 that is related to a module in any way, you will have to install that module in your D9 site, or the Migrate API won’t know to include it.)
    • Use Compo
@su-v
su-v / gist:9965739
Last active June 14, 2023 08:34
Inkscape / SVG on GitHub
@mrry
mrry / tensorflow_self_check.py
Last active August 24, 2023 17:13
[DEPRECATED] TensorFlow on Windows self-check
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n