Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# [SNIPPET_NAME: GtkSourceView Example]
# [SNIPPET_CATEGORIES: PyGTK, PyGTKSourceView]
# [SNIPPET_DESCRIPTION: Demonstrates using Actions with a gtk.Action and gtk.AccelGroup]
#
# This script shows the use of pygtksourceview module, the python wrapper
# of gtksourceview C library.
# It has been directly translated from test-widget.c
hdmi_force_hotplug=1
hdmi_drive=2
hdmi_group=87
hdmi_mode=4
hdmi_cvt=800 480 60 6 0 0 0
framebuffer_width=800
framebuffer_height=480
kernel=zImage
device_tree=bcm2710-rpi-3-b.dtb
dtparam=audio=on
@densh
densh / Snake.scala
Last active August 26, 2024 06:29
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
import scalanative.native._
import SDL._
import SDLExtra._
@extern
@link("SDL2")
object SDL {
type Window = CStruct0
type Renderer = CStruct0
@colophonemes
colophonemes / create_triggers
Last active February 1, 2025 14:53
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@wsargent
wsargent / win10-dev.md
Last active August 7, 2024 18:20
Windows Development Environment for Scala

Windows 10 Development Environment for Scala

This is a guide for Scala and Java development on Windows, using Windows Subsystem for Linux, although a bunch of it is applicable to a VirtualBox / Vagrant / Docker subsystem environment. This is not complete, but is intended to be as step by step as possible.

Harden Windows 10

Read the entire Decent Security guide, and follow the instructions, especially:

@alysonla
alysonla / active-issues.sql
Last active September 19, 2023 11:21
Queries that power the open source section of the 2016 Octoverse report https://octoverse.github.com/2016/
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery http://githubarchive.org/
SELECT
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$.issue.id')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@joelouismarino
joelouismarino / googlenet.py
Last active October 24, 2024 05:51
GoogLeNet in Keras
from __future__ import print_function
import imageio
from PIL import Image
import numpy as np
import keras
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, Concatenate, Reshape, Activation
from keras.models import Model
from keras.regularizers import l2
from keras.optimizers import SGD
import scalatags.Text.all._
import collection.mutable
// http://flatuicolors.com/
val red = "#c0392b"
val green = "#27ae60"
val yellow = "#f39c12"
val blue = "#2980b9"
val magenta = "#8e44ad"
val cyan = "#16a085"
val black = "#000"
@avramirez
avramirez / ForComprehensionFutureWithTypeCasting.scala
Last active September 21, 2020 18:25
Scala For comprehension on Future with Type Casting
/*
Resources :
http://www.scala-lang.org/files/archive/spec/2.11/08-pattern-matching.html#pattern-binders
Bug on SCALA for comprehension + pattern matching
https://issues.scala-lang.org/browse/SI-900
*/
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global