Skip to content

Instantly share code, notes, and snippets.

@1242035
1242035 / AdvancedAudioSynthesisDemoActivity.java
Created October 27, 2016 15:40 — forked from MasterEx/AdvancedAudioSynthesisDemoActivity.java
Audio Synthesis with android AudioTrack - 1
package pntanasis.master_ex.android;
import pntanasis.master_ex.android.Synthesizer.Note0;
import android.app.Activity;
import android.os.Bundle;
public class AudioSynthesisDemoActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
@1242035
1242035 / widget.js
Created August 1, 2017 16:51 — forked from lukencode/widget.js
Starter template for creating jsonp embeddable widgets.
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');
@1242035
1242035 / nginx.conf
Created August 10, 2017 19:29 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@1242035
1242035 / laravel-ums.markdown
Created August 18, 2017 09:35 — forked from anchetaWern/laravel-ums.markdown
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@1242035
1242035 / tinymce-4-email-plugin.js
Created August 30, 2017 04:34 — forked from Melros/tinymce-4-email-plugin.js
This plugin will insert a mailto: link by providing an email address within tinymce 4.
/*
1. Create a folder named "email" within "tinymce/plugins".
2. Create a file called "plugin.min.js" within the folder.
2. Paste the below code inside "tinymce/plugins/email/plugin.min.js"
3. Extend your tiny.init like:
tinymce.init({
plugins: "email",
toolbar: "email"
@1242035
1242035 / laravel-queue.service
Created September 30, 2017 13:28 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@1242035
1242035 / queue-main.service
Created September 30, 2017 13:29 — forked from p34eu/queue-main.service
Laravel queue worker using systemd
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue-main.service
#
# run this command to enable service:
# systemctl enable queue-main.service
[Unit]
Description=Laravel queue worker
var _ = require("lodash");
var path = require("path");
var env = process.env.NODE_ENV || "development";
var debug = ["development", "test"].indexOf(env) !== -1;
var defaults = {
cache: debug,
debug: debug,
@1242035
1242035 / ecc.py
Created May 25, 2018 03:34 — forked from bellbind/ecc.py
[python]basics of elliptic curve cryptography
# Basics of Elliptic Curve Cryptography implementation on Python
import collections
def inv(n, q):
"""div on PN modulo a/b mod q as a * inv(b, q) mod q
>>> assert n * inv(n, q) % q == 1
"""
for i in range(q):
if (n * i) % q == 1: